Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc/rc.d convert fsck.sh -> fsck (using kill -TERM $$ to sto...



details:   https://anonhg.NetBSD.org/src/rev/5740a40cdf0c
branches:  trunk
changeset: 496363:5740a40cdf0c
user:      lukem <lukem%NetBSD.org@localhost>
date:      Mon Aug 21 23:38:07 2000 +0000

description:
convert fsck.sh -> fsck (using kill -TERM $$ to stop autoboot).

diffstat:

 etc/rc.d/Makefile |  19 ++++++++-------
 etc/rc.d/fsck     |  68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 etc/rc.d/fsck.sh  |  57 ----------------------------------------------
 3 files changed, 78 insertions(+), 66 deletions(-)

diffs (163 lines):

diff -r 520925da7000 -r 5740a40cdf0c etc/rc.d/Makefile
--- a/etc/rc.d/Makefile Mon Aug 21 23:36:50 2000 +0000
+++ b/etc/rc.d/Makefile Mon Aug 21 23:38:07 2000 +0000
@@ -1,16 +1,17 @@
-# $NetBSD: Makefile,v 1.11 2000/08/10 22:02:07 thorpej Exp $
+# $NetBSD: Makefile,v 1.12 2000/08/21 23:38:07 lukem Exp $
 
 .include <bsd.own.mk>
 
 FILES= DAEMON LOGIN NETWORK SERVERS accounting amd apmd bootparams \
-       bootconf.sh ccd cleartmp cron dhclient dhcpd dhcrelay dmesg fsck.sh \
-       gated inetd ipfilter ipmon ipnat ipsec kdc ldconfig lkm1 lkm2 \
-       lkm3 local lpd mopd \
-       motd mountall mountcritlocal mountcritremote mountd mrouted named \
-       network nfsd nfslocking ntpd ntpdate rpcbind postfix ppp pwcheck quota \
-       raidframe rarpd rbootd root route6d routed rtadvd rtsold rwho savecore \
-       screenblank sendmail swap1 swap2 sysdb sysctl syslogd timed \
-       ttys virecover wscons xdm xfs ypbind yppasswdd ypserv
+       bootconf.sh ccd cleartmp cron dhclient dhcpd dhcrelay dmesg \
+       fsck gated inetd ipfilter ipmon ipnat ipsec kdc ldconfig \
+       lkm1 lkm2 lkm3 local lpd mopd motd mountall mountcritlocal \
+       mountcritremote mountd mrouted named network nfsd nfslocking \
+       ntpd ntpdate rpcbind postfix ppp pwcheck quota raidframe \
+       rarpd rbootd root route6d routed rtadvd rtsold rwho savecore \
+       screenblank sendmail securelevel swap1 swap2 sysdb sysctl \
+       syslogd timed ttys virecover wscons xdm xfs ypbind yppasswdd \
+       ypserv
 FILESDIR=      /etc/rc.d
 FILESMODE=     ${BINMODE}
 
diff -r 520925da7000 -r 5740a40cdf0c etc/rc.d/fsck
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/rc.d/fsck     Mon Aug 21 23:38:07 2000 +0000
@@ -0,0 +1,68 @@
+#!/bin/sh
+#
+# $NetBSD: fsck,v 1.1 2000/08/21 23:38:07 lukem Exp $
+#
+
+# PROVIDE: fsck
+# REQUIRE: localswap
+
+. /etc/rc.subr
+
+name="fsck"
+start_cmd="fsck_start"
+stop_cmd=":"
+
+stop_boot()
+{
+       #       Terminate the process (which may include the parent /etc/rc)
+       #       if booting directly to multiuser mode.
+       #
+       if [ "$autoboot" = yes ]; then
+               kill -TERM $$
+       fi
+       exit 1
+}
+
+fsck_start()
+{
+       if [ -e /fastboot ]; then
+               echo "Fast boot: skipping disk checks."
+       elif [ "$autoboot" = yes ]; then
+                                       # During fsck ignore SIGQUIT
+               trap : 3
+
+               echo "Automatic boot in progress: starting file system checks."
+               fsck -p
+               case $? in
+               0)
+                       ;;
+               2)
+                       stop_boot
+                       ;;
+               4)
+                       echo "Rebooting..."
+                       reboot
+                       echo "Reboot failed; help!"
+                       stop_boot
+                       ;;
+               8)
+                       echo "Automatic file system check failed; help!"
+                       stop_boot
+                       ;;
+               12)
+                       echo "Boot interrupted."
+                       stop_boot
+                       ;;
+               130)
+                       stop_boot
+                       ;;
+               *)
+                       echo "Unknown error; help!"
+                       stop_boot
+                       ;;
+               esac
+       fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff -r 520925da7000 -r 5740a40cdf0c etc/rc.d/fsck.sh
--- a/etc/rc.d/fsck.sh  Mon Aug 21 23:36:50 2000 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: fsck.sh,v 1.2 2000/04/26 05:13:51 thorpej Exp $
-#
-
-# PROVIDE: fsck
-# REQUIRE: localswap
-
-fsck_start()
-{
-       if [ -e /fastboot ]; then
-               echo "Fast boot: skipping disk checks."
-       elif [ "$autoboot" = yes ]; then
-                                       # During fsck ignore SIGQUIT
-               trap : 3
-
-               echo "Automatic boot in progress: starting file system checks."
-               fsck -p
-               case $? in
-               0)
-                       ;;
-               2)
-                       exit 1
-                       ;;
-               4)
-                       echo "Rebooting..."
-                       reboot
-                       echo "Reboot failed; help!"
-                       exit 1
-                       ;;
-               8)
-                       echo "Automatic file system check failed; help!"
-                       exit 1
-                       ;;
-               12)
-                       echo "Boot interrupted."
-                       exit 1
-                       ;;
-               130)
-                       exit 1
-                       ;;
-               *)
-                       echo "Unknown error; help!"
-                       exit 1
-                       ;;
-               esac
-
-                                       # Reset SIGQUIT handler.
-               trap "echo 'Boot interrupted.'; exit 1" 3
-       fi
-}
-
-case "$1" in
-*start)
-       fsck_start
-       ;;
-esac



Home | Main Index | Thread Index | Old Index