Jelajahi Sumber

Added stop_on_error parameter to rc.site and cleaned up Begin and End lines.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@9552 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
DJ Lucas 14 tahun lalu
induk
melakukan
f3f65e73a3

+ 3 - 0
lsb-bootscripts/ChangeLog

@@ -4,6 +4,9 @@
     symlink if ETCDIR is not /etc.
   * Makefile, etc/inittab: Removed the installation of /etc/inittab as this is
     done in the book.
+  * etc/default/rc, etc/default/rc.site: Added "stop_on_error" parameter to
+    rc.site file and added testcase on "stop_on_error" for FAILURE_ACTION in
+    rc file.
 
 2011-05-21	DJ Lucas <dj@linuxfromscratch.org>
   * lib/lsb/init-functions: Merged the contents of etc/init.d/lfs-functions and

+ 11 - 4
lsb-bootscripts/etc/default/rc

@@ -1,8 +1,5 @@
 # Begin /etc/default/rc
 
-# Author: DJ Lucas - dj@linuxfromscratch.org
-# Version: 1.0 LSB V.3.1
-
 # Global variable inherited by initscripts are in caps
 # Local variables for the rc script are in lowercase
 
@@ -10,7 +7,7 @@
 . /etc/default/rc.site
 
 # Set base directory information
-RC_BASE="ETCDIR"
+RC_BASE="/etc/rc.d"
 
 # Location of network device scripts and config files
 NETWORK_DEVICES="/etc/network"
@@ -74,6 +71,16 @@ ilen="38" # The total length of the interactive message
 welcome_message="Welcome to ${INFO}${DISTRO}${NORMAL}"
 i_message="Press '${FAILURE}I${NORMAL}' to enter interactive startup"
 
+# FAILURE_ACTION (what to do when script failure occurs)
+case "${stop_on_error}" in
+    Y* | y* | 0)
+        FAILURE_ACTION='read Enter'
+    ;;
+    *)
+        FAILURE_ACTION='echo ""'
+    ;;
+esac
+
 # Error message displayed when a script's exit value is not zero
 print_error_msg()
 {

+ 11 - 5
lsb-bootscripts/etc/default/rc.site

@@ -1,3 +1,8 @@
+# Begin /etc/default/rc.site
+
+# Global variable inherited by initscripts are in caps
+# Local variables for the rc script are in lowercase
+
 # Bootlogging (requires a tempfs mount)
 BOOTLOG_ENAB="yes"
 
@@ -8,14 +13,15 @@ HOSTNAME=<lfs>
 UTC=1
 CLOCKPARAMS=
 
-# Manual input is not appropriate on remote systems. Define what happens when
-# an error is encountered that interupts the boot/shutdown proceess
-FAILURE_ACTION="read ENTER"
-
 # Export varialbles so that they are inherited by the initscripts
-export BOOTLOG_ENAB HOSTNAME UTC CLOCKPARAMS FAILURE_ACTION
+export BOOTLOG_ENAB HOSTNAME UTC CLOCKPARAMS 
 
 # Interactive startup
 iprompt="yes" # Wether to display the interactive boot promp
 itime="2" # The ammount of time (in seconds) to display the prompt
 
+# Manual input is not appropriate on remote systems. Wait for user input on
+# script error?
+stop_on_error="yes"
+
+# End /etc/default/rc.site

+ 2 - 2
lsb-bootscripts/etc/init.d/checkfs

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin /etc/init.d/checkfs
+# Begin $RC_BASE/init.d/checkfs
 
 ### BEGIN INIT INFO
 # Provides:            checkfs
@@ -100,4 +100,4 @@ case "${1}" in
         ;;
 esac
 
-# End /etc/init.d/checkfs
+# End $RC_BASE/init.d/checkfs

+ 2 - 3
lsb-bootscripts/etc/init.d/cleanfs

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin /etc/init.d/cleanfs
+# Begin $RC_BASE/init.d/cleanfs
 
 ### BEGIN INIT INFO
 # Provides:            cleanfs
@@ -102,5 +102,4 @@ case "${1}" in
         ;;
 esac
 
-# End /etc/init.d/cleanfs
-
+# End $RC_BASE/init.d/cleanfs

+ 2 - 2
lsb-bootscripts/etc/init.d/console

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin $rc_base/init.d/console
+# Begin $RC_BASE/init.d/console
 
 ### BEGIN INIT INFO
 # Provides:            console
@@ -93,4 +93,4 @@ case "${1}" in
 		;;
 esac
 
-# End $rc_base/init.d/console
+# End $RC_BASE/init.d/console

+ 1 - 1
lsb-bootscripts/etc/init.d/halt

@@ -27,4 +27,4 @@ case "${1}" in
         ;;
 esac
 
-# End /etc/init.d/halt
+# End $RC_BASE/init.d/halt

+ 2 - 2
lsb-bootscripts/etc/init.d/localnet

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin /etc/init.d/localnet
+# Begin $RC_BASE/init.d/localnet
 
 ### BEGIN INIT INFO
 # Provides:            localnet
@@ -78,4 +78,4 @@ case "${1}" in
         ;;
 esac
 
-# End /etc/init.d/localnet
+# End $RC_BASE/init.d/localnet

+ 2 - 2
lsb-bootscripts/etc/init.d/modules

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin /etc/init.d/modules
+# Begin $RC_BASE/init.d/modules
 
 ### BEGIN INIT INFO
 # Provides:            modules
@@ -94,4 +94,4 @@ case "${1}" in
         ;;
 esac
 
-# End /etc/init.d/modules
+# End $RC_BASE/init.d/modules

+ 2 - 2
lsb-bootscripts/etc/init.d/mountfs

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin /etc/init.d/mountfs
+# Begin $RC_BASE/init.d/mountfs
 
 ### BEGIN INIT INFO
 # Provides:            $local_fs
@@ -56,4 +56,4 @@ case "${1}" in
         ;;
 esac
 
-# End /etc/init.d/mountfs
+# End $RC_BASE/init.d/mountfs

+ 2 - 2
lsb-bootscripts/etc/init.d/mountvirtfs

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin /etc/init.d/mountvirtfs
+# Begin $RC_BASE/init.d/mountvirtfs
 
 ### BEGIN INIT INFO
 # Provides:            mountvirtfs
@@ -43,4 +43,4 @@ case "${1}" in
         ;;
 esac
 
-# End /etc/init.d/mountvirtfs
+# End $RC_BASE/init.d/mountvirtfs

+ 2 - 2
lsb-bootscripts/etc/init.d/network

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin /etc/init.d/network
+# Begin $RC_BASE/init.d/network
 
 ### BEGIN INIT INFO
 # Provides:            $network
@@ -81,4 +81,4 @@ case "${1}" in
     ;;
 esac
 
-# End /etc/init.d/network
+# End $RC_BASE/init.d/network

+ 2 - 2
lsb-bootscripts/etc/init.d/reboot

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin /etc/init.d/reboot
+# Begin $RC_BASE/init.d/reboot
 
 ### BEGIN INIT INFO
 # Provides:            reboot
@@ -29,4 +29,4 @@ case "${1}" in
 
 esac
 
-# End /etc/init.d/reboot
+# End $RC_BASE/init.d/reboot

+ 2 - 2
lsb-bootscripts/etc/init.d/sendsignals

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin /etc/init.d/sendsignals
+# Begin $RC_BASE/init.d/sendsignals
 
 ### BEGIN INIT INFO
 # Provides:            sendsignals
@@ -51,4 +51,4 @@ case "${1}" in
 
 esac
 
-# End /etc/init.d/sendsignals
+# End $RC_BASE/init.d/sendsignals

+ 2 - 2
lsb-bootscripts/etc/init.d/setclock

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin /etc/init.d/setclock
+# Begin $RC_BASE/init.d/setclock
 
 ### BEGIN INIT INFO
 # Provides:            hwclock
@@ -51,4 +51,4 @@ case ${1} in
 
 esac
 
-# End /etc/init.d/setclock
+# End $RC_BASE/init.d/setclock

+ 2 - 2
lsb-bootscripts/etc/init.d/swap

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin /etc/init.d/swap
+# Begin $RC_BASE/init.d/swap
 
 ### BEGIN INIT INFO
 # Provides:            swap
@@ -52,4 +52,4 @@ case "${1}" in
         ;;
 esac
 
-# End /etc/init.d/swap
+# End $RC_BASE/init.d/swap

+ 2 - 2
lsb-bootscripts/etc/init.d/sysctl

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin /etc/init.d/sysctl
+# Begin $RC_BASE/init.d/sysctl
 
 ### BEGIN INIT INFO
 # Provides:            sysctl
@@ -36,4 +36,4 @@ case "${1}" in
         ;;
 esac
 
-# End /etc/init.d/sysctl
+# End $RC_BASE/init.d/sysctl

+ 2 - 2
lsb-bootscripts/etc/init.d/sysklogd

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin /etc/init.d/sysklogd
+# Begin $RC_BASE/init.d/sysklogd
 
 ### BEGIN INIT INFO
 # Provides:            $syslog
@@ -66,4 +66,4 @@ case "${1}" in
         ;;
 esac
 
-# End /etc/init.d/sysklogd
+# End $RC_BASE/init.d/sysklogd

+ 2 - 2
lsb-bootscripts/etc/init.d/template

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin /etc/init.d/template
+# Begin $RC_BASE/init.d/template
 
 ### BEGIN INIT INFO
 # Provides:            template
@@ -87,4 +87,4 @@ case "${1}" in
         ;;
 esac
 
-# End /etc/init.d/template
+# End $RC_BASE/init.d/template

+ 2 - 2
lsb-bootscripts/etc/init.d/udev

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin $rc_base/init.d/udev
+# Begin $RC_BASE/init.d/udev
 
 ### BEGIN INIT INFO
 # Provides:            udev
@@ -87,4 +87,4 @@ case "${1}" in
 		;;
 esac
 
-# End $rc_base/init.d/udev
+# End $RC_BASE/init.d/udev

+ 2 - 2
lsb-bootscripts/etc/init.d/udev_retry

@@ -1,5 +1,5 @@
 #!/bin/sh
-# Begin $rc_base/init.d/udev_retry
+# Begin $RC_BASE/init.d/udev_retry
 
 ### BEGIN INIT INFO
 # Provides:            udev_retry
@@ -46,4 +46,4 @@ case "${1}" in
 		;;
 esac
 
-# End $rc_base/init.d/udev_retry
+# End $RC_BASE/init.d/udev_retry