aboutsummaryrefslogtreecommitdiffstats
path: root/bootscripts/contrib/lsb-v3/etc/init.d
diff options
context:
space:
mode:
Diffstat (limited to 'bootscripts/contrib/lsb-v3/etc/init.d')
-rw-r--r--bootscripts/contrib/lsb-v3/etc/init.d/cleanfs6
-rw-r--r--bootscripts/contrib/lsb-v3/etc/init.d/console8
-rw-r--r--bootscripts/contrib/lsb-v3/etc/init.d/modules10
-rw-r--r--bootscripts/contrib/lsb-v3/etc/init.d/mountvirtfs7
-rw-r--r--bootscripts/contrib/lsb-v3/etc/init.d/network7
-rw-r--r--bootscripts/contrib/lsb-v3/etc/init.d/rc29
-rw-r--r--bootscripts/contrib/lsb-v3/etc/init.d/template2
-rw-r--r--bootscripts/contrib/lsb-v3/etc/init.d/udev16
8 files changed, 45 insertions, 40 deletions
diff --git a/bootscripts/contrib/lsb-v3/etc/init.d/cleanfs b/bootscripts/contrib/lsb-v3/etc/init.d/cleanfs
index 96582c28c..2e71456ee 100644
--- a/bootscripts/contrib/lsb-v3/etc/init.d/cleanfs
+++ b/bootscripts/contrib/lsb-v3/etc/init.d/cleanfs
@@ -12,7 +12,7 @@
# Short-Description: Cleans temporary directories early in the boot process.
# Description: Cleans temporary directories /var/run, /var/lock, and
# /tmp. cleanfs also creates /var/run/utmp and any files
-# defined in /etc/sysconfig/createfiles.
+# defined in /etc/default/createfiles.
# X-LFS-Provided-By: LFS
### END INIT INFO
@@ -22,7 +22,7 @@
create_files()
{
# Read in the configuration file.
- exec 9>&0 < /etc/sysconfig/createfiles
+ exec 9>&0 < /etc/default/createfiles
while read name type perm usr grp dtype maj min junk
do
# Ignore comments and blank lines.
@@ -89,7 +89,7 @@ case "${1}" in
(exit ${failed})
evaluate_retval standard
- if egrep -qv '^(#|$)' /etc/sysconfig/createfiles 2>/dev/null
+ if egrep -qv '^(#|$)' /etc/default/createfiles 2>/dev/null
then
message="Creating files and directories..."
create_files
diff --git a/bootscripts/contrib/lsb-v3/etc/init.d/console b/bootscripts/contrib/lsb-v3/etc/init.d/console
index 8b26f57d5..45c87b6dd 100644
--- a/bootscripts/contrib/lsb-v3/etc/init.d/console
+++ b/bootscripts/contrib/lsb-v3/etc/init.d/console
@@ -11,7 +11,7 @@
# Default-Stop:
# Short-Description: Sets up a localised console.
# Description: Sets up fonts and language settings for the user's
-# local as defined by /etc/sysconfig/console.
+# local as defined by /etc/default/console.
# X-LFS-Provided-By: LFS
### END INIT INFO
@@ -19,10 +19,10 @@
MESSAGE="Setting up Linux console..."
-# Native English speakers probably don't have /etc/sysconfig/console at all
-if [ -f /etc/sysconfig/console ]
+# Native English speakers probably don't have /etc/default/console at all
+if [ -f /etc/default/console ]
then
- . /etc/sysconfig/console
+ . /etc/default/console
fi
is_true() {
diff --git a/bootscripts/contrib/lsb-v3/etc/init.d/modules b/bootscripts/contrib/lsb-v3/etc/init.d/modules
index 2dd1d7212..18febfbc0 100644
--- a/bootscripts/contrib/lsb-v3/etc/init.d/modules
+++ b/bootscripts/contrib/lsb-v3/etc/init.d/modules
@@ -10,7 +10,7 @@
# Default-Start: S
# Default-Stop:
# Short-Description: Loads required modules.
-# Description: Loads modules listed in /etc/sysconfig/modules.
+# Description: Loads modules listed in /etc/default/modules.
# X-LFS-Provided-By: LFS
### END INIT INFO
@@ -24,8 +24,8 @@ case "${1}" in
# Exit if there's no modules file or there are no
# valid entries
- [ -r /etc/sysconfig/modules ] &&
- egrep -qv '^($|#)' /etc/sysconfig/modules ||
+ [ -r /etc/default/modules ] &&
+ egrep -qv '^($|#)' /etc/default/modules ||
exit 0
# If proc is mounted, find the current kernel
@@ -44,11 +44,11 @@ case "${1}" in
# Only try to load modules if the user has actually given us
# some modules to load.
- if egrep -qv '^(#|$)' /etc/sysconfig/modules 2>/dev/null
+ if egrep -qv '^(#|$)' /etc/default/modules 2>/dev/null
then
# Read in the configuration file.
- exec 9>&0 < /etc/sysconfig/modules
+ exec 9>&0 < /etc/default/modules
message="${INFO}Loading modules:"
diff --git a/bootscripts/contrib/lsb-v3/etc/init.d/mountvirtfs b/bootscripts/contrib/lsb-v3/etc/init.d/mountvirtfs
index e458f9c7f..994976934 100644
--- a/bootscripts/contrib/lsb-v3/etc/init.d/mountvirtfs
+++ b/bootscripts/contrib/lsb-v3/etc/init.d/mountvirtfs
@@ -30,11 +30,8 @@ case "${1}" in
mount -n /sys || failed=1
fi
- if ! mountpoint /run > /dev/null; then
- message="${message}${INFO} /run${NORMAL}"
- mount -n /run || failed=1
- mkdir /run/{var,lock,shm} || failed=1
- fi
+ # create needed directories in /run
+ mkdir /run/{var,lock,shm} || failed=1
(exit ${failed})
evaluate_retval standard
diff --git a/bootscripts/contrib/lsb-v3/etc/init.d/network b/bootscripts/contrib/lsb-v3/etc/init.d/network
index 29d4d54c8..ec11d5e38 100644
--- a/bootscripts/contrib/lsb-v3/etc/init.d/network
+++ b/bootscripts/contrib/lsb-v3/etc/init.d/network
@@ -15,7 +15,6 @@
### END INIT INFO
. /lib/lsb/init-functions
-. /etc/sysconfig/network
case "${1}" in
start)
@@ -29,14 +28,14 @@ case "${1}" in
then
continue
fi
- IN_BOOT=1 ${NETWORK_DEVICES}/ifup ${interface}
+ IN_BOOT=1 /sbin/ifup ${interface}
done
;;
stop)
# Reverse list
FILES=""
- for file in ${NETWORK_DEVICES}/ifconfig.*
+ for file in /run/network/ifconfig.*
do
FILES="${file} ${FILES}"
done
@@ -52,7 +51,7 @@ case "${1}" in
continue
fi
- IN_BOOT=1 ${NETWORK_DEVICES}/ifdown ${interface}
+ IN_BOOT=1 /sbin/ifdown ${interface}
done
;;
diff --git a/bootscripts/contrib/lsb-v3/etc/init.d/rc b/bootscripts/contrib/lsb-v3/etc/init.d/rc
index 24e26ee07..edad963a5 100644
--- a/bootscripts/contrib/lsb-v3/etc/init.d/rc
+++ b/bootscripts/contrib/lsb-v3/etc/init.d/rc
@@ -3,7 +3,7 @@
# Get the configuration file
# All changes are to occur in the config file
-. /etc/sysconfig/rc
+. /etc/default/rc
# These 3 signals will not cause our script to exit
trap "" INT QUIT TSTP
@@ -25,9 +25,9 @@ if [ "${prevlevel}" = "" ]; then
prevlevel="N"
fi
-# Mount a tmpfs to store boot accounting information
-if [ "${runlevel}" = "S" -a "${TEMPFS_MOUNT}" != "" ]; then
- mount -n -t tmpfs tmpfs "${TEMPFS_MOUNT}" -o mode=600
+# Mount /run
+if [ "${runlevel}" = "S" ]; then
+ mount -n -t tmpfs tmpfs /run
fi
# Provide an interactive prompt (if requested)
@@ -52,7 +52,7 @@ if [ "${runlevel}" = "S" -a "${iprompt}" = "yes" ]; then
if [ "${interactive}" = "I" -o "${interactive}" = "i" ]; then
echo -n -e "${CURS_UP}"
echo -e "${INFO}Interactive boot selected...${NORMAL}"
- echo "interactive=I" > "${TEMPFS_MOUNT}/.interactive-start"
+ echo "interactive=I" > /run/.interactive-start
fi
fi
fi
@@ -66,8 +66,8 @@ if [ ! -d "${RC_BASE}/rc${runlevel}.d" ]; then
fi
# Source the interactive state file if it exists
-if [ "${runlevel}" != "S" -a -f "${TEMPFS_MOUNT}/.interactive-start" ]; then
- . "${TEMPFS_MOUNT}/.interactive-start"
+if [ "${runlevel}" != "S" -a -f /run/.interactive-start ]; then
+ . /run/.interactive-start
fi
# Prompt for interactive startup after completing S
@@ -180,17 +180,22 @@ done
# Strip apply time to the logs, strip out any color codes and dump
# the log to /var/log/boot.log
-if [ -f "${TEMPFS_MOUNT}/.bootlog" -a "${runlevel}" != "S" ]; then
+if [ -f /run/.bootlog -a "${runlevel}" != "S" ]; then
# Remove any color codes from the temp log file
- sed -i 's@\\033\[[0-9];[0-9][0-9]m@@g' "${TEMPFS_MOUNT}/.bootlog"
+ sed -i 's@\\033\[[0-9];[0-9][0-9]m@@g' /run/.bootlog
#Fix the time and hostname
BTIMESPEC=$(echo `date +"%b %d %T"` `hostname`)
- sed -i "s@^bootlog:@${BTIMESPEC} bootlog:@" "${TEMPFS_MOUNT}/.bootlog"
+ sed -i "s@^bootlog:@${BTIMESPEC} bootlog:@" /run/.bootlog
# Don't try and write in 0 and 6, this is a 'boot' log
if [ "${runlevel}" != "0" -a "${runlevel}" != "6" ]; then
- cat "${TEMPFS_MOUNT}/.bootlog" >> /var/log/boot.log
- rm -f "${TEMPFS_MOUNT}/.bootlog"
+ cat /run/.bootlog >> /var/log/boot.log
+ rm -f /run/.bootlog
fi
fi
+# Remove interactive boot temp file
+if [ -f /run/.interactive-start -a "${runlevel}" != "S" ]; then
+ rm -f /run/.interactive-start
+fi
+
# End $RC_BASE/init.d/rc
diff --git a/bootscripts/contrib/lsb-v3/etc/init.d/template b/bootscripts/contrib/lsb-v3/etc/init.d/template
index cb3222a35..d10d98c56 100644
--- a/bootscripts/contrib/lsb-v3/etc/init.d/template
+++ b/bootscripts/contrib/lsb-v3/etc/init.d/template
@@ -24,7 +24,7 @@
# documentaion in the lfs-fucntions file for more information.
MESSAGE="Template Service"
BIN_FILE="/some/path/to/template"
-CONFIGFILE="/etc/sysconfig/template.conf"
+CONFIGFILE="/etc/default/template.conf"
# check that $BIN_FILE exists and is executable, and $CONFIGFILE exists.
chk_stat
diff --git a/bootscripts/contrib/lsb-v3/etc/init.d/udev b/bootscripts/contrib/lsb-v3/etc/init.d/udev
index ac91fccf3..fd17b5e94 100644
--- a/bootscripts/contrib/lsb-v3/etc/init.d/udev
+++ b/bootscripts/contrib/lsb-v3/etc/init.d/udev
@@ -33,10 +33,11 @@ case "${1}" in
/etc/rc.d/init.d/halt stop
fi
- # Mount a temporary file system over /dev, so that any devices
- # made or removed during this boot don't affect the next one.
- # The reason we don't write to mtab is because we don't ever
- # want /dev to be unavailable (such as by `umount -a').
+ # If not using DEVTMPFS mount a temporary file system over
+ # /dev, so that any devices made or removed during this boot
+ # don't affect the next one. The reason we don't write to mtab
+ # is because we don't ever want /dev to be unavailable (such as
+ # by `umount -a').
if ! mountpoint /dev > /dev/null; then
mount -n -t tmpfs tmpfs /dev -o mode=755
fi
@@ -57,11 +58,14 @@ case "${1}" in
# Udev handles uevents itself, so we don't need to have
# the kernel call out to any binary in response to them
+ # This is a failsafe and should be done in kernel config
echo > /proc/sys/kernel/hotplug
# Copy the only static device node that Udev >= 155 doesn't
- # handle to /dev
- cp -a /lib/udev/devices/null /dev
+ # handle to /dev (handled by default with DEVTMPFS)
+ if [ ! -f /dev/null ]; then
+ cp -a /lib/udev/devices/null /dev
+ fi
# Start the udev daemon to continually watch for, and act on,
# uevents