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
This commit is contained in:
DJ Lucas 2011-05-23 05:07:21 +00:00
parent 90b457477d
commit f3f65e73a3
21 changed files with 60 additions and 45 deletions

View File

@ -4,6 +4,9 @@
symlink if ETCDIR is not /etc. symlink if ETCDIR is not /etc.
* Makefile, etc/inittab: Removed the installation of /etc/inittab as this is * Makefile, etc/inittab: Removed the installation of /etc/inittab as this is
done in the book. 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> 2011-05-21 DJ Lucas <dj@linuxfromscratch.org>
* lib/lsb/init-functions: Merged the contents of etc/init.d/lfs-functions and * lib/lsb/init-functions: Merged the contents of etc/init.d/lfs-functions and

View File

@ -1,8 +1,5 @@
# Begin /etc/default/rc # 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 # Global variable inherited by initscripts are in caps
# Local variables for the rc script are in lowercase # Local variables for the rc script are in lowercase
@ -10,7 +7,7 @@
. /etc/default/rc.site . /etc/default/rc.site
# Set base directory information # Set base directory information
RC_BASE="ETCDIR" RC_BASE="/etc/rc.d"
# Location of network device scripts and config files # Location of network device scripts and config files
NETWORK_DEVICES="/etc/network" NETWORK_DEVICES="/etc/network"
@ -74,6 +71,16 @@ ilen="38" # The total length of the interactive message
welcome_message="Welcome to ${INFO}${DISTRO}${NORMAL}" welcome_message="Welcome to ${INFO}${DISTRO}${NORMAL}"
i_message="Press '${FAILURE}I${NORMAL}' to enter interactive startup" 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 # Error message displayed when a script's exit value is not zero
print_error_msg() print_error_msg()
{ {

View File

@ -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) # Bootlogging (requires a tempfs mount)
BOOTLOG_ENAB="yes" BOOTLOG_ENAB="yes"
@ -8,14 +13,15 @@ HOSTNAME=<lfs>
UTC=1 UTC=1
CLOCKPARAMS= 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 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 # Interactive startup
iprompt="yes" # Wether to display the interactive boot promp iprompt="yes" # Wether to display the interactive boot promp
itime="2" # The ammount of time (in seconds) to display the prompt 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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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