From eca4159416849fec4618dfa9b4f85fbfc57980d9 Mon Sep 17 00:00:00 2001 From: Mike Karels Date: Sun, 27 Aug 1989 03:12:59 -0800 Subject: [PATCH] more robust if reboot fails after fixing root; faster preen of /tmp; log existence of /etc/ptmp SCCS-vsn: etc/rc 5.5 --- usr/src/etc/rc | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/usr/src/etc/rc b/usr/src/etc/rc index e2a410dc09..b3870e2c8b 100644 --- a/usr/src/etc/rc +++ b/usr/src/etc/rc @@ -1,5 +1,5 @@ # -# @(#)rc 5.4 (Berkeley) %G% +# @(#)rc 5.5 (Berkeley) %G% # HOME=/; export HOME @@ -22,15 +22,21 @@ then ;; 4) reboot -n + echo "reboot -n failed... help!" >/dev/console + exit 1 ;; 8) - echo "Automatic reboot failed... help!" >/dev/console + echo "Automatic file system check failed... help!" >/dev/console exit 1 ;; 12) echo "Reboot interrupted" >/dev/console exit 1 ;; + 130) + # interrupt before catcher installed + exit 1 + ;; *) echo "Unknown error in reboot" > /dev/console exit 1 @@ -38,13 +44,6 @@ then esac fi -# check the password file -if [ -f /etc/ptmp ] -then - echo 'password file may be incorrect -- /etc/ptmp exists' \ - > /dev/console -fi - umount -a : >/etc/mtab swapon -a >/dev/console 2>&1 @@ -80,9 +79,17 @@ if [ -d /var/crash ]; then savecore /var/crash >/dev/console 2>&1 fi +# check the password temp/lock file +if [ -f /etc/ptmp ] +then + logger -s -p auth.err \ + 'password file may be incorrect -- /etc/ptmp exists' >/dev/console 2>&1 +fi + echo preserving editor files >/dev/console (cd /tmp; /usr/libexec/ex3.7preserve -a) echo clearing /tmp >/dev/console +(cd /tmp; rm -rf [a-km-pr-zA-Z]* ) (cd /tmp; find . ! -name . ! -name lost+found ! -name quotas -exec rm -r {} \; ) echo -n standard daemons: >/dev/console -- 2.20.1