From 352806ecf32064d3f84e690dc624e0a0aac0507b Mon Sep 17 00:00:00 2001 From: cjc Date: Mon, 11 Mar 2002 08:47:02 +0000 Subject: [PATCH] Don't protect savecore(8) from being run with a bad dumpdir argument. Don't fail silently, but let savecore(8) make noise. It won't behave badly, it doesn't need protection. At the same time, allow the administrator to have dumpdev enabled while dumpdir (savecore(8)) is disabled and document how to do it. PR: conf/35725 --- etc/rc | 11 ++++++++--- share/man/man5/rc.conf.5 | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/etc/rc b/etc/rc index 345959b7bbf1..40a26d8e1ded 100644 --- a/etc/rc +++ b/etc/rc @@ -552,12 +552,17 @@ case ${dumpdev} in '') dumpdir='/var/crash' ;; + [Nn][Oo]) + dumpdir='NO' + ;; esac - if [ -e "${dumpdev}" -a -d "${dumpdir}" ]; then + if [ -e "${dumpdev}" ]; then /sbin/dumpon -v ${dumpdev} - echo -n 'Checking for core dump: ' - /sbin/savecore ${savecore_flags} "${dumpdir}" + if [ "$dumpdir" != 'NO' ]; then + echo -n 'Checking for core dump: ' + /sbin/savecore ${savecore_flags} "${dumpdir}" + fi fi ;; esac diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 91d7c419b58e..4b463d3fabc8 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -1727,6 +1727,13 @@ specified by the variable. The default value is .Dq /var/crash . +Set to +.Dq NO +to not run +.Xr savecore 8 +at boot time when +.Va dumpdir +is set. .It Va enable_quotas .Pq Vt bool Set to