diff options
author | mtm <mtm@FreeBSD.org> | 2008-06-23 20:54:32 +0000 |
---|---|---|
committer | mtm <mtm@FreeBSD.org> | 2008-06-23 20:54:32 +0000 |
commit | 0203c01701d045d8cccc12f303fdd5dc4c2a6c1b (patch) | |
tree | 9d2361cc232a7bcf911c352cebc0e0ffcac503d9 /etc/rc.d/savecore | |
parent | ebef621a5c0d1fa0503febee26676d0844ab24a3 (diff) | |
download | FreeBSD-src-0203c01701d045d8cccc12f303fdd5dc4c2a6c1b.zip FreeBSD-src-0203c01701d045d8cccc12f303fdd5dc4c2a6c1b.tar.gz |
Run savecore(8) only if there is a core dump to save. If there is
no core dump hide the message to that effect behind $rc_quiet.
Diffstat (limited to 'etc/rc.d/savecore')
-rwxr-xr-x | etc/rc.d/savecore | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/etc/rc.d/savecore b/etc/rc.d/savecore index 428f7ac..2dd0761 100755 --- a/etc/rc.d/savecore +++ b/etc/rc.d/savecore @@ -57,8 +57,11 @@ savecore_prestart() savecore_start() { - [ -z "${rc_quiet}" ] && echo "Checking for core dump on ${dumpdev}..." - savecore ${savecore_flags} ${DUMPDIR} ${dumpdev} + if savecore -C >/dev/null; then + savecore ${savecore_flags} ${DUMPDIR} ${dumpdev} + else + [ -z "${rc_quiet}" ] && echo "No core dumps found" + fi } load_rc_config $name |