summaryrefslogtreecommitdiffstats
path: root/etc/rc
diff options
context:
space:
mode:
authorcjc <cjc@FreeBSD.org>2002-03-12 20:59:35 +0000
committercjc <cjc@FreeBSD.org>2002-03-12 20:59:35 +0000
commit17b6d49a7c29d8b5b950d4a16ba4bf33ac7dc8e8 (patch)
tree8b52cc0c498b96c9e682bde843e5171e59cb9895 /etc/rc
parentf11a52179b4c56ca21ed8c80628c298b276e00e5 (diff)
downloadFreeBSD-src-17b6d49a7c29d8b5b950d4a16ba4bf33ac7dc8e8.zip
FreeBSD-src-17b6d49a7c29d8b5b950d4a16ba4bf33ac7dc8e8.tar.gz
Run dumpon(8) early so crashes during startup can be caught. In
addition, take out the checks on the $dumpdev. dumpon(8) behaves well if given a non-existent filename. It gives a nice error message which is better rather than the current silent failure. Reviewed by: des
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc31
1 files changed, 17 insertions, 14 deletions
diff --git a/etc/rc b/etc/rc
index 40a26d8..c5e51c7 100644
--- a/etc/rc
+++ b/etc/rc
@@ -108,6 +108,17 @@ chkdepend NFS nfs_server_enable portmap portmap_enable
chkdepend NIS nis_server_enable portmap portmap_enable
chkdepend NIS nis_client_enable portmap portmap_enable
+# Enable dumpdev early so that a crash during the boot process can be caught.
+#
+case ${dumpdev} in
+[Nn][Oo] | '')
+ dumpdev='NO'
+ ;;
+*)
+ /sbin/dumpon -v ${dumpdev}
+ ;;
+esac
+
# Enable harvesting of entropy via devices. The sooner this happens the
# better so that we can take advantage of the boot process.
#
@@ -540,14 +551,10 @@ else
dev_mkdb
fi
-# Enable dumpdev so that savecore can see it.
-# /var/crash should be a directory or a symbolic link
+# $dumpdir should be a directory or a symbolic link
# to the crash directory if core dumps are to be saved.
#
-case ${dumpdev} in
-[Nn][Oo] | '')
- ;;
-*)
+if [ "${dumpdev}" != 'NO' ]; then
case ${dumpdir} in
'')
dumpdir='/var/crash'
@@ -557,15 +564,11 @@ case ${dumpdev} in
;;
esac
- if [ -e "${dumpdev}" ]; then
- /sbin/dumpon -v ${dumpdev}
- if [ "$dumpdir" != 'NO' ]; then
- echo -n 'Checking for core dump: '
- /sbin/savecore ${savecore_flags} "${dumpdir}"
- fi
+ if [ "${dumpdir}" != 'NO' ]; then
+ echo -n 'Checking for core dump: '
+ /sbin/savecore ${savecore_flags} "${dumpdir}"
fi
- ;;
-esac
+fi
if [ -n "${network_pass1_done}" ]; then
network_pass2
OpenPOWER on IntegriCloud