diff options
Diffstat (limited to 'etc/rc.d/init.d')
29 files changed, 0 insertions, 2104 deletions
diff --git a/etc/rc.d/init.d/acpid b/etc/rc.d/init.d/acpid deleted file mode 100755 index 0531670d..00000000 --- a/etc/rc.d/init.d/acpid +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin acpid -# -# Description : ACPI event daemon boot script -# -# Author : Igor Živković <[email protected]> -# -# Version : BLFS 8.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: acpid -# Required-Start: -# Should-Start: $syslog -# Required-Stop: -# Should-Stop: $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Starts Advanced Configuration and Power Interface event daemon -# X-LFS-Provided-By: BLFS -### END INIT INFO - -. /lib/lsb/init-functions - -case "$1" in - start) - log_info_msg "Starting ACPI event daemon..." - start_daemon /usr/sbin/acpid - sleep 1 - pidofproc -p "/run/acpid.pid" > /dev/null - evaluate_retval - ;; - - stop) - log_info_msg "Stopping ACPI event daemon..." - killproc -p "/run/acpid.pid" /usr/sbin/acpid - evaluate_retval - ;; - - restart) - $0 stop - sleep 1 - $0 start - ;; - - status) - statusproc /usr/sbin/acpid - ;; - - *) - echo "Usage: $0 {start|stop|restart|status}" - exit 1 - ;; -esac - -# End acpid diff --git a/etc/rc.d/init.d/bluetooth b/etc/rc.d/init.d/bluetooth deleted file mode 100755 index 1d9b4b75..00000000 --- a/etc/rc.d/init.d/bluetooth +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -. /lib/lsb/init-functions - -if [ -f "/etc/sysconfig/bluetooth" ]; then - . /etc/sysconfig/bluetooth -fi - -BLUETOOTH=/usr/sbin/bluetoothd -SDPTOOL=/usr/bin/sdptool -HCIATTACH=/usr/bin/hciattach -RFCOMM=/usr/bin/rfcomm - -UART_CONF=/etc/bluetooth/uart.conf -RFCOMM_CONF=/etc/bluetooth/rfcomm.conf - -case "${1}" in - start) - log_info_msg "Starting Bluetooth daemon bluetoothd..." - pidlist=`pidofproc $BLUETOOTH` - - if [ "${?}" = "0" ]; then - log_info_msg2 " Already running" - log_success_msg2 - exit 0; - fi - - # Start as background process and assume OK - $BLUETOOTH & - log_success_msg2 - - ;; - - stop) - - log_info_msg "Stopping Bluetooth daemon bluetoothd..." - killproc $BLUETOOTH - evaluate_retval - ;; - - restart) - ${0} stop - sleep 1 - ${0} start - ;; - - status) - statusproc $BLUETOOTH - ;; - - *) - echo "Usage: ${0} {start|stop|restart|status}" - exit 1 - ;; -esac - -exit 0 diff --git a/etc/rc.d/init.d/checkfs b/etc/rc.d/init.d/checkfs deleted file mode 100755 index 0903a011..00000000 --- a/etc/rc.d/init.d/checkfs +++ /dev/null @@ -1,149 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin checkfs -# -# Description : File System Check -# -# Authors : Gerard Beekmans - [email protected] -# A. Luebke - [email protected] -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# -# Version : LFS 7.0 -# -# Based on checkfs script from LFS-3.1 and earlier. -# -# From man fsck -# 0 - No errors -# 1 - File system errors corrected -# 2 - System should be rebooted -# 4 - File system errors left uncorrected -# 8 - Operational error -# 16 - Usage or syntax error -# 32 - Fsck canceled by user request -# 128 - Shared library error -# -######################################################################### - -### BEGIN INIT INFO -# Provides: checkfs -# Required-Start: udev swap -# Should-Start: -# Required-Stop: -# Should-Stop: -# Default-Start: S -# Default-Stop: -# Short-Description: Checks local filesystems before mounting. -# Description: Checks local filesystems before mounting. -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions - -case "${1}" in - start) - if [ -f /fastboot ]; then - msg="/fastboot found, will omit " - msg="${msg} file system checks as requested.\n" - log_info_msg "${msg}" - exit 0 - fi - - log_info_msg "Mounting root file system in read-only mode... " - mount -n -o remount,ro / >/dev/null - - if [ ${?} != 0 ]; then - log_failure_msg2 - msg="\n\nCannot check root " - msg="${msg}filesystem because it could not be mounted " - msg="${msg}in read-only mode.\n\n" - msg="${msg}After you press Enter, this system will be " - msg="${msg}halted and powered off.\n\n" - log_failure_msg "${msg}" - - log_info_msg "Press Enter to continue..." - wait_for_user - /etc/rc.d/init.d/halt stop - else - log_success_msg2 - fi - - if [ -f /forcefsck ]; then - msg="/forcefsck found, forcing file" - msg="${msg} system checks as requested." - log_success_msg "$msg" - options="-f" - else - options="" - fi - - log_info_msg "Checking file systems..." - # Note: -a option used to be -p; but this fails e.g. on fsck.minix - if is_true "$VERBOSE_FSCK"; then - fsck ${options} -a -A -C -T - else - fsck ${options} -a -A -C -T >/dev/null - fi - - error_value=${?} - - if [ "${error_value}" = 0 ]; then - log_success_msg2 - fi - - if [ "${error_value}" = 1 ]; then - msg="\nWARNING:\n\nFile system errors " - msg="${msg}were found and have been corrected.\n" - msg="${msg} You may want to double-check that " - msg="${msg}everything was fixed properly." - log_warning_msg "$msg" - fi - - if [ "${error_value}" = 2 -o "${error_value}" = 3 ]; then - msg="\nWARNING:\n\nFile system errors " - msg="${msg}were found and have been been " - msg="${msg}corrected, but the nature of the " - msg="${msg}errors require this system to be rebooted.\n\n" - msg="${msg}After you press enter, " - msg="${msg}this system will be rebooted\n\n" - log_failure_msg "$msg" - - log_info_msg "Press Enter to continue..." - wait_for_user - reboot -f - fi - - if [ "${error_value}" -gt 3 -a "${error_value}" -lt 16 ]; then - msg="\nFAILURE:\n\nFile system errors " - msg="${msg}were encountered that could not be " - msg="${msg}fixed automatically.\nThis system " - msg="${msg}cannot continue to boot and will " - msg="${msg}therefore be halted until those " - msg="${msg}errors are fixed manually by a " - msg="${msg}System Administrator.\n\n" - msg="${msg}After you press Enter, this system will be " - msg="${msg}halted and powered off.\n\n" - log_failure_msg "$msg" - - log_info_msg "Press Enter to continue..." - wait_for_user - /etc/rc.d/init.d/halt stop - fi - - if [ "${error_value}" -ge 16 ]; then - msg="FAILURE:\n\nUnexpected failure " - msg="${msg}running fsck. Exited with error " - msg="${msg} code: ${error_value}.\n" - log_info_msg $msg - exit ${error_value} - fi - - exit 0 - ;; - *) - echo "Usage: ${0} {start}" - exit 1 - ;; -esac - -# End checkfs diff --git a/etc/rc.d/init.d/chrony b/etc/rc.d/init.d/chrony deleted file mode 100755 index 7b03ffee..00000000 --- a/etc/rc.d/init.d/chrony +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -. /lib/lsb/init-functions - -case "${1}" in - start) - log_info_msg "Starting chronyd..." - start_daemon /usr/sbin/chronyd - evaluate_retval - ;; - - stop) - log_info_msg "Stopping chronyd..." - killproc /usr/sbin/chronyd - evaluate_retval - ;; - - restart) - ${0} stop - sleep 1 - ${0} start - ;; - - *) - echo "Usage: ${0} {start|stop|restart}" - exit 1 - ;; -esac - -exit 0 diff --git a/etc/rc.d/init.d/cleanfs b/etc/rc.d/init.d/cleanfs deleted file mode 100755 index 9ab994fc..00000000 --- a/etc/rc.d/init.d/cleanfs +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin cleanfs -# -# Description : Clean file system -# -# Authors : Gerard Beekmans - [email protected] -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# -# Version : LFS 7.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: cleanfs -# Required-Start: $local_fs -# Should-Start: -# Required-Stop: -# Should-Stop: -# Default-Start: S -# Default-Stop: -# Short-Description: Cleans temporary directories early in the boot process. -# Description: Cleans temporary directories /run, /var/lock, and -# optionally, /tmp. cleanfs also creates /run/utmp -# and any files defined in /etc/sysconfig/createfiles. -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions - -# Function to create files/directory on boot. -create_files() -{ - # Input to file descriptor 9 and output to stdin (redirection) - exec 9>&0 < /etc/sysconfig/createfiles - - while read name type perm usr grp dtype maj min junk - do - # Ignore comments and blank lines. - case "${name}" in - ""|\#*) continue ;; - esac - - # Ignore existing files. - if [ ! -e "${name}" ]; then - # Create stuff based on its type. - case "${type}" in - dir) - mkdir "${name}" - ;; - file) - :> "${name}" - ;; - dev) - case "${dtype}" in - char) - mknod "${name}" c ${maj} ${min} - ;; - block) - mknod "${name}" b ${maj} ${min} - ;; - pipe) - mknod "${name}" p - ;; - *) - log_warning_msg "\nUnknown device type: ${dtype}" - ;; - esac - ;; - *) - log_warning_msg "\nUnknown type: ${type}" - continue - ;; - esac - - # Set up the permissions, too. - chown ${usr}:${grp} "${name}" - chmod ${perm} "${name}" - fi - done - - # Close file descriptor 9 (end redirection) - exec 0>&9 9>&- - return 0 -} - -case "${1}" in - start) - log_info_msg "Cleaning file systems:" - - if [ "${SKIPTMPCLEAN}" = "" ]; then - log_info_msg2 " /tmp" - cd /tmp && - find . -xdev -mindepth 1 ! -name lost+found -delete || failed=1 - fi - - > /run/utmp - - if grep -q '^utmp:' /etc/group ; then - chmod 664 /run/utmp - chgrp utmp /run/utmp - fi - - (exit ${failed}) - evaluate_retval - - if grep -E -qv '^(#|$)' /etc/sysconfig/createfiles 2>/dev/null; then - log_info_msg "Creating files and directories... " - create_files # Always returns 0 - evaluate_retval - fi - - exit $failed - ;; - *) - echo "Usage: ${0} {start}" - exit 1 - ;; -esac - -# End cleanfs diff --git a/etc/rc.d/init.d/console b/etc/rc.d/init.d/console deleted file mode 100755 index a5338cc7..00000000 --- a/etc/rc.d/init.d/console +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin console -# -# Description : Sets keymap and screen font -# -# Authors : Gerard Beekmans - [email protected] -# Alexander E. Patrakov -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# -# Version : LFS 7.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: console -# Required-Start: $local_fs -# Should-Start: udev_retry -# Required-Stop: -# Should-Stop: -# Default-Start: S -# 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. -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions - -# Native English speakers probably don't have /etc/sysconfig/console at all -[ -r /etc/sysconfig/console ] && . /etc/sysconfig/console - -failed=0 - -case "${1}" in - start) - # See if we need to do anything - if [ -z "${KEYMAP}" ] && [ -z "${KEYMAP_CORRECTIONS}" ] && - [ -z "${FONT}" ] && [ -z "${LEGACY_CHARSET}" ] && - ! is_true "${UNICODE}"; then - exit 0 - fi - - # There should be no bogus failures below this line! - log_info_msg "Setting up Linux console..." - - # Figure out if a framebuffer console is used - [ -d /sys/class/graphics/fb0 ] && use_fb=1 || use_fb=0 - - # Figure out the command to set the console into the - # desired mode - is_true "${UNICODE}" && - MODE_COMMAND="echo -en '\033%G' && kbd_mode -u" || - MODE_COMMAND="echo -en '\033%@\033(K' && kbd_mode -a" - - # On framebuffer consoles, font has to be set for each vt in - # UTF-8 mode. This doesn't hurt in non-UTF-8 mode also. - - ! is_true "${use_fb}" || [ -z "${FONT}" ] || - MODE_COMMAND="${MODE_COMMAND} && setfont ${FONT}" - - # Apply that command to all consoles mentioned in - # /etc/inittab. Important: in the UTF-8 mode this should - # happen before setfont, otherwise a kernel bug will - # show up and the unicode map of the font will not be - # used. - - for TTY in `grep '^[^#].*respawn:/sbin/agetty' /etc/inittab | - grep -o '\btty[[:digit:]]*\b'` - do - openvt -f -w -c ${TTY#tty} -- \ - /bin/sh -c "${MODE_COMMAND}" || failed=1 - done - - # Set the font (if not already set above) and the keymap - [ "${use_fb}" == "1" ] || [ -z "${FONT}" ] || setfont $FONT || failed=1 - - [ -z "${KEYMAP}" ] || - loadkeys ${KEYMAP} >/dev/null 2>&1 || - failed=1 - - [ -z "${KEYMAP_CORRECTIONS}" ] || - loadkeys ${KEYMAP_CORRECTIONS} >/dev/null 2>&1 || - failed=1 - - # Convert the keymap from $LEGACY_CHARSET to UTF-8 - [ -z "$LEGACY_CHARSET" ] || - dumpkeys -c "$LEGACY_CHARSET" | loadkeys -u >/dev/null 2>&1 || - failed=1 - - # If any of the commands above failed, the trap at the - # top would set $failed to 1 - ( exit $failed ) - evaluate_retval - - exit $failed - ;; - - *) - echo "Usage: ${0} {start}" - exit 1 - ;; -esac - -# End console diff --git a/etc/rc.d/init.d/dbus b/etc/rc.d/init.d/dbus deleted file mode 100755 index 368deaf5..00000000 --- a/etc/rc.d/init.d/dbus +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin dbus -# -# Description : Start dbus daemon -# -# Author : Bruce Dubbs - [email protected] -# -# Version : BLFS 7.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: dbus messagebus -# Required-Start: -# Should-Start: $syslog random -# Required-Stop: -# Should-Stop: $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Starts message bus. -# Description: Starts message bus. -# X-LFS-Provided-By: BLFS -### END INIT INFO - -. /lib/lsb/init-functions - -#$LastChangedBy$ -#$Date$ - -pidfile=/run/dbus/pid -socket=/run/dbus/system_bus_socket - -case "$1" in - start) - log_info_msg "Starting the D-Bus Messagebus Daemon..." - mkdir -p /run/dbus - /usr/bin/dbus-uuidgen --ensure - start_daemon /usr/bin/dbus-daemon --system - evaluate_retval - ;; - - stop) - log_info_msg "Stopping the D-Bus Messagebus Daemon..." - killproc /usr/bin/dbus-daemon - evaluate_retval - rm -f $socket $pidfile - ;; - - restart) - $0 stop - sleep 1 - $0 start - ;; - - status) - statusproc /usr/bin/dbus-daemon - ;; - - *) - echo "Usage: $0 {start|stop|restart|status}" - exit 1 - ;; -esac - -# End /etc/init.d/dbus diff --git a/etc/rc.d/init.d/dhcpcd b/etc/rc.d/init.d/dhcpcd deleted file mode 100755 index 342707a3..00000000 --- a/etc/rc.d/init.d/dhcpcd +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -. /lib/lsb/init-functions - -case "${1}" in - start) - log_info_msg "Starting dhcpcd..." - start_daemon /sbin/dhcpcd - evaluate_retval - ;; - - stop) - log_info_msg "Stopping dhcpcd..." - killproc /sbin/dhcpcd - evaluate_retval - ;; - - restart) - ${0} stop - sleep 1 - ${0} start - ;; - - *) - echo "Usage: ${0} {start|stop|restart}" - exit 1 - ;; -esac - -exit 0 diff --git a/etc/rc.d/init.d/elogind b/etc/rc.d/init.d/elogind deleted file mode 100755 index e66b4492..00000000 --- a/etc/rc.d/init.d/elogind +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -. /lib/lsb/init-functions - -case "${1}" in - start) - log_info_msg "Starting elogind..." - start_daemon /usr/lib/elogind/elogind --daemon - evaluate_retval - ;; - - stop) - log_info_msg "Stopping elogind..." - # if it is possible to use killproc - killproc /usr/lib/elogind/elogind - evaluate_retval - ;; - - restart) - ${0} stop - sleep 1 - ${0} start - ;; - - *) - echo "Usage: ${0} {start|stop|restart}" - exit 1 - ;; -esac - -exit 0 diff --git a/etc/rc.d/init.d/halt b/etc/rc.d/init.d/halt deleted file mode 100755 index 46ccecf4..00000000 --- a/etc/rc.d/init.d/halt +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin halt -# -# Description : Halt Script -# -# Authors : Gerard Beekmans - [email protected] -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# : Pierre Labastie - [email protected] -# -# Version : LFS 7.0 -# -# Notes : Update March 24th, 2022: change "stop" to "start". -# Add the $last facility to Required-start -# -######################################################################## - -### BEGIN INIT INFO -# Provides: halt -# Required-Start: $last -# Should-Start: -# Required-Stop: -# Should-Stop: -# Default-Start: 0 -# Default-Stop: -# Short-Description: Halts the system. -# Description: Halts the System. -# X-LFS-Provided-By: LFS -### END INIT INFO - -case "${1}" in - start) - halt -d -f -i -p - ;; - - *) - echo "Usage: {start}" - exit 1 - ;; -esac - -# End halt diff --git a/etc/rc.d/init.d/keyd b/etc/rc.d/init.d/keyd deleted file mode 100755 index 8d6814b9..00000000 --- a/etc/rc.d/init.d/keyd +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -. /lib/lsb/init-functions - -case "${1}" in - start) - log_info_msg "Starting keyd..." - start_daemon /usr/bin/keyd & - evaluate_retval - ;; - - stop) - log_info_msg "Stopping keyd..." - killproc /usr/bin/keyd - evaluate_retval - ;; - - restart) - ${0} stop - sleep 1 - ${0} start - ;; - - *) - echo "Usage: ${0} {start|stop|restart}" - exit 1 - ;; -esac - -exit 0 diff --git a/etc/rc.d/init.d/localnet b/etc/rc.d/init.d/localnet deleted file mode 100755 index 83d63a07..00000000 --- a/etc/rc.d/init.d/localnet +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin localnet -# -# Description : Loopback device -# -# Authors : Gerard Beekmans - [email protected] -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# -# Version : LFS 7.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: localnet -# Required-Start: mountvirtfs -# Should-Start: modules -# Required-Stop: -# Should-Stop: -# Default-Start: S -# Default-Stop: 0 6 -# Short-Description: Starts the local network. -# Description: Sets the hostname of the machine and starts the -# loopback interface. -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions -[ -r /etc/sysconfig/network ] && . /etc/sysconfig/network -[ -r /etc/hostname ] && HOSTNAME=`cat /etc/hostname` - -case "${1}" in - start) - log_info_msg "Bringing up the loopback interface..." - ip addr add 127.0.0.1/8 label lo dev lo - ip link set lo up - evaluate_retval - - log_info_msg "Setting hostname to ${HOSTNAME}..." - hostname ${HOSTNAME} - evaluate_retval - ;; - - stop) - log_info_msg "Bringing down the loopback interface..." - ip link set lo down - evaluate_retval - ;; - - restart) - ${0} stop - sleep 1 - ${0} start - ;; - - status) - echo "Hostname is: $(hostname)" - ip link show lo - ;; - - *) - echo "Usage: ${0} {start|stop|restart|status}" - exit 1 - ;; -esac - -exit 0 - -# End localnet diff --git a/etc/rc.d/init.d/modules b/etc/rc.d/init.d/modules deleted file mode 100755 index 19d7b138..00000000 --- a/etc/rc.d/init.d/modules +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin modules -# -# Description : Module auto-loading script -# -# Authors : Zack Winkles -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# -# Version : LFS 7.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: modules -# Required-Start: mountvirtfs -# Should-Start: -# Required-Stop: -# Should-Stop: -# Default-Start: S -# Default-Stop: -# Short-Description: Loads required modules. -# Description: Loads modules listed in /etc/sysconfig/modules. -# X-LFS-Provided-By: LFS -### END INIT INFO - -# Assure that the kernel has module support. -[ -e /proc/modules ] || exit 0 - -. /lib/lsb/init-functions - -case "${1}" in - start) - # Exit if there's no modules file or there are no - # valid entries - [ -r /etc/sysconfig/modules ] || exit 0 - grep -E -qv '^($|#)' /etc/sysconfig/modules || exit 0 - - log_info_msg "Loading modules:" - - # Only try to load modules if the user has actually given us - # some modules to load. - - while read module args; do - - # Ignore comments and blank lines. - case "$module" in - ""|"#"*) continue ;; - esac - - # Attempt to load the module, passing any arguments provided. - modprobe ${module} ${args} >/dev/null - - # Print the module name if successful, otherwise take note. - if [ $? -eq 0 ]; then - log_info_msg2 " ${module}" - else - failedmod="${failedmod} ${module}" - fi - done < /etc/sysconfig/modules - - # Print a message about successfully loaded modules on the correct line. - log_success_msg2 - - # Print a failure message with a list of any modules that - # may have failed to load. - if [ -n "${failedmod}" ]; then - log_failure_msg "Failed to load modules:${failedmod}" - exit 1 - fi - ;; - - *) - echo "Usage: ${0} {start}" - exit 1 - ;; -esac - -exit 0 - -# End modules diff --git a/etc/rc.d/init.d/mountfs b/etc/rc.d/init.d/mountfs deleted file mode 100755 index cd9407dc..00000000 --- a/etc/rc.d/init.d/mountfs +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin mountfs -# -# Description : File System Mount Script -# -# Authors : Gerard Beekmans - [email protected] -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# -# Version : LFS 7.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: $local_fs -# Required-Start: udev checkfs -# Should-Start: modules -# Required-Stop: localnet -# Should-Stop: -# Default-Start: S -# Default-Stop: 0 6 -# Short-Description: Mounts/unmounts local filesystems defined in /etc/fstab. -# Description: Remounts root filesystem read/write and mounts all -# remaining local filesystems defined in /etc/fstab on -# start. Remounts root filesystem read-only and unmounts -# remaining filesystems on stop. -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions - -case "${1}" in - start) - log_info_msg "Remounting root file system in read-write mode..." - mount --options remount,rw / >/dev/null - evaluate_retval - - # Remove fsck-related file system watermarks. - rm -f /fastboot /forcefsck - - # Make sure /dev/pts exists - mkdir -p /dev/pts - - # This will mount all filesystems that do not have _netdev in - # their option list. _netdev denotes a network filesystem. - - log_info_msg "Mounting remaining file systems..." - failed=0 - mount --all --test-opts no_netdev >/dev/null || failed=1 - evaluate_retval - exit $failed - ;; - - stop) - # Don't unmount virtual file systems like /run - log_info_msg "Unmounting all other currently mounted file systems..." - # Ensure any loop devices are removed - losetup -D - umount --all --detach-loop --read-only \ - --types notmpfs,nosysfs,nodevtmpfs,noproc,nodevpts >/dev/null - evaluate_retval - - # Make sure / is mounted read only (umount bug) - mount --options remount,ro / - - # Make all LVM volume groups unavailable, if appropriate - # This fails if swap or / are on an LVM partition - #if [ -x /sbin/vgchange ]; then /sbin/vgchange -an > /dev/null; fi - if [ -r /etc/mdadm.conf ]; then - log_info_msg "Mark arrays as clean..." - mdadm --wait-clean --scan - evaluate_retval - fi - ;; - - *) - echo "Usage: ${0} {start|stop}" - exit 1 - ;; -esac - -# End mountfs diff --git a/etc/rc.d/init.d/mountvirtfs b/etc/rc.d/init.d/mountvirtfs deleted file mode 100755 index fd797787..00000000 --- a/etc/rc.d/init.d/mountvirtfs +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin mountvirtfs -# -# Description : Ensure proc, sysfs, run, and dev are mounted -# -# Authors : Gerard Beekmans - [email protected] -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# Xi Ruoyao - [email protected] -# -# Version : LFS 12.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: mountvirtfs -# Required-Start: $first -# Should-Start: -# Required-Stop: -# Should-Stop: -# Default-Start: S -# Default-Stop: -# Short-Description: Mounts various special fs needed at start -# Description: Mounts /sys and /proc virtual (kernel) filesystems. -# Mounts /run (tmpfs) and /dev (devtmpfs). -# This is done only if they are not already mounted. -# with the kernel config proposed in the book, dev -# should be automatically mounted by the kernel. -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions - -case "${1}" in - start) - # Make sure /run is available before logging any messages - if ! mountpoint /run >/dev/null; then - mount /run || failed=1 - fi - - mkdir -p /run/lock - chmod 1777 /run/lock - - log_info_msg "Mounting virtual file systems: ${INFO}/run" - - if ! mountpoint /proc >/dev/null; then - log_info_msg2 " ${INFO}/proc" - mount -o nosuid,noexec,nodev /proc || failed=1 - fi - - if ! mountpoint /sys >/dev/null; then - log_info_msg2 " ${INFO}/sys" - mount -o nosuid,noexec,nodev /sys || failed=1 - fi - - if ! mountpoint /dev >/dev/null; then - log_info_msg2 " ${INFO}/dev" - mount -o mode=0755,nosuid /dev || failed=1 - fi - - mkdir -p /dev/shm - log_info_msg2 " ${INFO}/dev/shm" - mount -o nosuid,nodev /dev/shm || failed=1 - - mkdir -p /sys/fs/cgroup - log_info_msg2 " ${INFO}/sys/fs/cgroup" - mount -o nosuid,noexec,nodev /sys/fs/cgroup || failed=1 - - (exit ${failed}) - evaluate_retval - if [ "${failed}" = 1 ]; then - exit 1 - fi - - log_info_msg "Create symlinks in /dev targeting /proc: ${INFO}/dev/stdin" - ln -sf /proc/self/fd/0 /dev/stdin || failed=1 - - log_info_msg2 " ${INFO}/dev/stdout" - ln -sf /proc/self/fd/1 /dev/stdout || failed=1 - - log_info_msg2 " ${INFO}/dev/stderr" - ln -sf /proc/self/fd/2 /dev/stderr || failed=1 - - log_info_msg2 " ${INFO}/dev/fd" - ln -sf /proc/self/fd /dev/fd || failed=1 - - if [ -e /proc/kcore ]; then - log_info_msg2 " ${INFO}/dev/core" - ln -sf /proc/kcore /dev/core || failed=1 - fi - - (exit ${failed}) - evaluate_retval - exit $failed - ;; - - *) - echo "Usage: ${0} {start}" - exit 1 - ;; -esac - -# End mountvirtfs diff --git a/etc/rc.d/init.d/network b/etc/rc.d/init.d/network deleted file mode 100755 index 5b2dd9b9..00000000 --- a/etc/rc.d/init.d/network +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin network -# -# Description : Network Control Script -# -# Authors : Gerard Beekmans - [email protected] -# Nathan Coulson - [email protected] -# Kevin P. Fleming - [email protected] -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# -# Version : LFS 7.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: $network -# Required-Start: $local_fs localnet swap -# Should-Start: $syslog firewalld iptables nftables -# Required-Stop: $local_fs localnet swap -# Should-Stop: $syslog firewalld iptables nftables -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Starts and configures network interfaces. -# Description: Starts and configures network interfaces. -# X-LFS-Provided-By: LFS -### END INIT INFO - -case "${1}" in - start) - # if the default route exists, network is already configured - if ip route | grep -q "^default"; then return 0; fi - # Start all network interfaces - for file in /etc/sysconfig/ifconfig.* - do - interface=${file##*/ifconfig.} - - # Skip if $file is * (because nothing was found) - if [ "${interface}" = "*" ]; then continue; fi - - /sbin/ifup ${interface} - done - ;; - - stop) - # Unmount any network mounted file systems - umount --all --force --types nfs,cifs,nfs4 - - # Reverse list - net_files="" - for file in /etc/sysconfig/ifconfig.* - do - net_files="${file} ${net_files}" - done - - # Stop all network interfaces - for file in ${net_files} - do - interface=${file##*/ifconfig.} - - # Skip if $file is * (because nothing was found) - if [ "${interface}" = "*" ]; then continue; fi - - # See if interface exists - if [ ! -e /sys/class/net/$interface ]; then continue; fi - - # Is interface UP? - ip link show $interface 2>/dev/null | grep -q "state UP" - if [ $? -ne 0 ]; then continue; fi - - /sbin/ifdown ${interface} - done - ;; - - restart) - ${0} stop - sleep 1 - ${0} start - ;; - - *) - echo "Usage: ${0} {start|stop|restart}" - exit 1 - ;; -esac - -exit 0 - -# End network diff --git a/etc/rc.d/init.d/rc b/etc/rc.d/init.d/rc deleted file mode 100755 index dd855a71..00000000 --- a/etc/rc.d/init.d/rc +++ /dev/null @@ -1,227 +0,0 @@ -#!/bin/bash -######################################################################## -# Begin rc -# -# Description : Main Run Level Control Script -# -# Authors : Gerard Beekmans - [email protected] -# : DJ Lucas - [email protected] -# Updates : Bruce Dubbs - [email protected] -# : Pierre Labastie - [email protected] -# -# Version : LFS 7.0 -# -# Notes : Updates March 24th, 2022: new semantics of S/K files -# - Instead of testing that S scripts were K scripts in the -# previous runlevel, test that they were not S scripts -# - Instead of testing that K scripts were S scripts in the -# previous runlevel, test that they were not K scripts -# - S scripts in runlevel 0 or 6 are now run with -# "script start" (was "script stop" previously). -######################################################################## - -. /lib/lsb/init-functions - -print_error_msg() -{ - log_failure_msg - # $i is set when called - MSG="FAILURE:\n\nYou should not be reading this error message.\n\n" - MSG="${MSG}It means that an unforeseen error took place in\n" - MSG="${MSG}${i},\n" - MSG="${MSG}which exited with a return value of ${error_value}.\n" - - MSG="${MSG}If you're able to track this error down to a bug in one of\n" - MSG="${MSG}the files provided by the ${DISTRO_MINI} book,\n" - MSG="${MSG}please be so kind to inform us at ${DISTRO_CONTACT}.\n" - log_failure_msg "${MSG}" - - log_info_msg "Press Enter to continue..." - wait_for_user -} - -check_script_status() -{ - # $i is set when called - if [ ! -f ${i} ]; then - log_warning_msg "${i} is not a valid symlink." - SCRIPT_STAT="1" - fi - - if [ ! -x ${i} ]; then - log_warning_msg "${i} is not executable, skipping." - SCRIPT_STAT="1" - fi -} - -run() -{ - if [ -z $interactive ]; then - ${1} ${2} - return $? - fi - - while true; do - read -p "Run ${1} ${2} (Yes/no/continue)? " -n 1 runit - echo - - case ${runit} in - c | C) - interactive="" - ${i} ${2} - ret=${?} - break; - ;; - - n | N) - return 0 - ;; - - y | Y) - ${i} ${2} - ret=${?} - break - ;; - esac - done - - return $ret -} - -# Read any local settings/overrides -[ -r /etc/sysconfig/rc.site ] && source /etc/sysconfig/rc.site - -DISTRO=${DISTRO:-"Linux From Scratch"} -DISTRO_CONTACT=${DISTRO_CONTACT:-"[email protected] (Registration required)"} -DISTRO_MINI=${DISTRO_MINI:-"LFS"} -IPROMPT=${IPROMPT:-"no"} - -# These 3 signals will not cause our script to exit -trap "" INT QUIT TSTP - -[ "${1}" != "" ] && runlevel=${1} - -if [ "${runlevel}" == "" ]; then - echo "Usage: ${0} <runlevel>" >&2 - exit 1 -fi - -previous=${PREVLEVEL} -[ "${previous}" == "" ] && previous=N - -if [ ! -d /etc/rc.d/rc${runlevel}.d ]; then - log_info_msg "/etc/rc.d/rc${runlevel}.d does not exist.\n" - exit 1 -fi - -if [ "$runlevel" == "6" -o "$runlevel" == "0" ]; then IPROMPT="no"; fi - -# Note: In ${LOGLEVEL:-7}, it is ':' 'dash' '7', not minus 7 -if [ "$runlevel" == "S" ]; then - [ -r /etc/sysconfig/console ] && source /etc/sysconfig/console - dmesg -n "${LOGLEVEL:-7}" -fi - -if [ "${IPROMPT}" == "yes" -a "${runlevel}" == "S" ]; then - # The total length of the distro welcome string, without escape codes - wlen=${wlen:-$(echo "Welcome to ${DISTRO}" | wc -c )} - welcome_message=${welcome_message:-"Welcome to ${INFO}${DISTRO}${NORMAL}"} - - # The total length of the interactive string, without escape codes - ilen=${ilen:-$(echo "Press 'I' to enter interactive startup" | wc -c )} - i_message=${i_message:-"Press '${FAILURE}I${NORMAL}' to enter interactive startup"} - - - # dcol and icol are spaces before the message to center the message - # on screen. itime is the amount of wait time for the user to press a key - wcol=$(( ( ${COLUMNS} - ${wlen} ) / 2 )) - icol=$(( ( ${COLUMNS} - ${ilen} ) / 2 )) - itime=${itime:-"3"} - - echo -e "\n\n" - echo -e "\\033[${wcol}G${welcome_message}" - echo -e "\\033[${icol}G${i_message}${NORMAL}" - echo "" - read -t "${itime}" -n 1 interactive 2>&1 > /dev/null -fi - -# Make lower case -[ "${interactive}" == "I" ] && interactive="i" -[ "${interactive}" != "i" ] && interactive="" - -# Read the state file if it exists from runlevel S -[ -r /run/interactive ] && source /run/interactive - -# Stop all services marked as K, except if marked as K in the previous -# runlevel: it is the responsibility of the script to not try to kill -# a non running service -if [ "${previous}" != "N" ]; then - for i in $(ls -v /etc/rc.d/rc${runlevel}.d/K* 2> /dev/null) - do - check_script_status - if [ "${SCRIPT_STAT}" == "1" ]; then - SCRIPT_STAT="0" - continue - fi - - suffix=${i#/etc/rc.d/rc${runlevel}.d/K[0-9][0-9]} - [ -e /etc/rc.d/rc${previous}.d/K[0-9][0-9]$suffix ] && continue - - run ${i} stop - error_value=${?} - - if [ "${error_value}" != "0" ]; then print_error_msg; fi - done -fi - -if [ "${previous}" == "N" ]; then export IN_BOOT=1; fi - -if [ "$runlevel" == "6" -a -n "${FASTBOOT}" ]; then - touch /fastboot -fi - - -# Start all services marked as S in this runlevel, except if marked as -# S in the previous runlevel -# it is the responsibility of the script to not try to start an already running -# service -for i in $( ls -v /etc/rc.d/rc${runlevel}.d/S* 2> /dev/null) -do - - if [ "${previous}" != "N" ]; then - suffix=${i#/etc/rc.d/rc${runlevel}.d/S[0-9][0-9]} - [ -e /etc/rc.d/rc${previous}.d/S[0-9][0-9]$suffix ] && continue - fi - - check_script_status - if [ "${SCRIPT_STAT}" == "1" ]; then - SCRIPT_STAT="0" - continue - fi - - run ${i} start - - error_value=${?} - - if [ "${error_value}" != "0" ]; then print_error_msg; fi -done - -# Store interactive variable on switch from runlevel S and remove if not -if [ "${runlevel}" == "S" -a "${interactive}" == "i" ]; then - echo "interactive=\"i\"" > /run/interactive -else - rm -f /run/interactive 2> /dev/null -fi - -# Copy the boot log on initial boot only -if [ "${previous}" == "N" -a "${runlevel}" != "S" ]; then - cat $BOOTLOG >> /var/log/boot.log - - # Mark the end of boot - echo "--------" >> /var/log/boot.log - - # Remove the temporary file - rm -f $BOOTLOG 2> /dev/null -fi - -# End rc diff --git a/etc/rc.d/init.d/reboot b/etc/rc.d/init.d/reboot deleted file mode 100755 index b41b0339..00000000 --- a/etc/rc.d/init.d/reboot +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin reboot -# -# Description : Reboot Scripts -# -# Authors : Gerard Beekmans - [email protected] -# DJ Lucas - [email protected] -# Updates : Bruce Dubbs - [email protected] -# : Pierre Labastie - [email protected] -# -# Version : LFS 7.0 -# -# Notes : Update March 24th, 2022: change "stop" to "start". -# Add the $last facility to Required-start -# -######################################################################## - -### BEGIN INIT INFO -# Provides: reboot -# Required-Start: $last -# Should-Start: -# Required-Stop: -# Should-Stop: -# Default-Start: 6 -# Default-Stop: -# Short-Description: Reboots the system. -# Description: Reboots the System. -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions - -case "${1}" in - start) - log_info_msg "Restarting system..." - reboot -d -f -i - ;; - - *) - echo "Usage: ${0} {start}" - exit 1 - ;; - -esac - -# End reboot diff --git a/etc/rc.d/init.d/sendsignals b/etc/rc.d/init.d/sendsignals deleted file mode 100755 index d2c80eb2..00000000 --- a/etc/rc.d/init.d/sendsignals +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin sendsignals -# -# Description : Sendsignals Script -# -# Authors : Gerard Beekmans - [email protected] -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# -# Version : LFS 7.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: sendsignals -# Required-Start: -# Should-Start: -# Required-Stop: $local_fs swap localnet -# Should-Stop: -# Default-Start: -# Default-Stop: 0 6 -# Short-Description: Attempts to kill remaining processes. -# Description: Attempts to kill remaining processes. -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions - -case "${1}" in - stop) - omit=$(pidof mdmon) - [ -n "$omit" ] && omit="-o $omit" - - log_info_msg "Sending all processes the TERM signal..." - killall5 -15 $omit - error_value=${?} - - sleep ${KILLDELAY} - - if [ "${error_value}" = 0 -o "${error_value}" = 2 ]; then - log_success_msg - else - log_failure_msg - fi - - log_info_msg "Sending all processes the KILL signal..." - killall5 -9 $omit - error_value=${?} - - sleep ${KILLDELAY} - - if [ "${error_value}" = 0 -o "${error_value}" = 2 ]; then - log_success_msg - else - log_failure_msg - fi - ;; - - *) - echo "Usage: ${0} {stop}" - exit 1 - ;; - -esac - -exit 0 - -# End sendsignals diff --git a/etc/rc.d/init.d/setclock b/etc/rc.d/init.d/setclock deleted file mode 100755 index cd4f617a..00000000 --- a/etc/rc.d/init.d/setclock +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin setclock -# -# Description : Setting Linux Clock -# -# Authors : Gerard Beekmans - [email protected] -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# -# Version : LFS 7.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: -# Required-Start: -# Should-Start: modules -# Required-Stop: -# Should-Stop: $syslog -# Default-Start: S -# Default-Stop: -# Short-Description: Stores and restores time from the hardware clock -# Description: On boot, system time is obtained from hwclock. The -# hardware clock can also be set on shutdown. -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions - -[ -r /etc/sysconfig/clock ] && . /etc/sysconfig/clock - - -case "${UTC}" in - yes|true|1) - CLOCKPARAMS="${CLOCKPARAMS} --utc" - ;; - - no|false|0) - CLOCKPARAMS="${CLOCKPARAMS} --localtime" - ;; - -esac - -case ${1} in - start) - hwclock --hctosys ${CLOCKPARAMS} >/dev/null - ;; - - stop) - log_info_msg "Setting hardware clock..." - hwclock --systohc ${CLOCKPARAMS} >/dev/null - evaluate_retval - ;; - - *) - echo "Usage: ${0} {start|stop}" - exit 1 - ;; - -esac - -exit 0 diff --git a/etc/rc.d/init.d/sshd b/etc/rc.d/init.d/sshd deleted file mode 100755 index ab5a41cb..00000000 --- a/etc/rc.d/init.d/sshd +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin sshd -# -# Description : Start sshd daemon -# -# Author : Bruce Dubbs - [email protected] -# -# Version : BLFS 7.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: sshd -# Required-Start: $network -# Should-Start: networkmanager wicd krb5 openldap samba -# Required-Stop: $network -# Should-Stop: networkmanager wicd krb5 openldap samba -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Starts sshd daemon. -# Description: Starts sshd daemon. -# X-LFS-Provided-By: BLFS -### END INIT INFO - -. /lib/lsb/init-functions - -case "$1" in - start) - log_info_msg "Starting SSH Server..." - start_daemon -f /usr/sbin/sshd - evaluate_retval - # Also prevent ssh from being killed by out of memory conditions - sleep 1 - pid=`cat /run/sshd.pid 2>/dev/null` - echo "-16" >/proc/${pid}/oom_score_adj - ;; - - stop) - log_info_msg "Stopping SSH Server..." - killproc -p "/run/sshd.pid" /usr/sbin/sshd - evaluate_retval - ;; - - reload) - log_info_msg "Reloading SSH Server..." - pid=`cat /run/sshd.pid 2>/dev/null` - - if [ -n "${pid}" ]; then - kill -HUP "${pid}" - else - (exit 1) - fi - - evaluate_retval - ;; - - restart) - $0 stop - sleep 1 - $0 start - ;; - - status) - statusproc /usr/sbin/sshd - ;; - - *) - echo "Usage: $0 {start|stop|reload|restart|status}" - exit 1 - ;; -esac - -# End sshd bootscript diff --git a/etc/rc.d/init.d/swap b/etc/rc.d/init.d/swap deleted file mode 100755 index 14075ae1..00000000 --- a/etc/rc.d/init.d/swap +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin swap -# -# Description : Swap Control Script -# -# Authors : Gerard Beekmans - [email protected] -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# -# Version : LFS 7.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: swap -# Required-Start: udev -# Should-Start: modules -# Required-Stop: localnet -# Should-Stop: $local_fs -# Default-Start: S -# Default-Stop: 0 6 -# Short-Description: Activates and deactivates swap partitions. -# Description: Activates and deactivates swap partitions defined in -# /etc/fstab. -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions - -case "${1}" in - start) - log_info_msg "Activating all swap files/partitions..." - swapon -a - evaluate_retval - ;; - - stop) - log_info_msg "Deactivating all swap files/partitions..." - swapoff -a - evaluate_retval - ;; - - restart) - ${0} stop - sleep 1 - ${0} start - ;; - - status) - log_success_msg "Retrieving swap status." - swapon -s - ;; - - *) - echo "Usage: ${0} {start|stop|restart|status}" - exit 1 - ;; -esac - -exit 0 - -# End swap diff --git a/etc/rc.d/init.d/sysctl b/etc/rc.d/init.d/sysctl deleted file mode 100755 index c90da9de..00000000 --- a/etc/rc.d/init.d/sysctl +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin sysctl -# -# Description : File uses /etc/sysctl.conf to set kernel runtime -# parameters -# -# Authors : Nathan Coulson ([email protected]) -# Matthew Burgress ([email protected]) -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# -# Version : LFS 7.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: sysctl -# Required-Start: mountvirtfs -# Should-Start: console -# Required-Stop: -# Should-Stop: -# Default-Start: S -# Default-Stop: -# Short-Description: Makes changes to the proc filesystem -# Description: Makes changes to the proc filesystem as defined in -# /etc/sysctl.conf. See 'man sysctl(8)'. -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions - -case "${1}" in - start) - if [ -f "/etc/sysctl.conf" ]; then - log_info_msg "Setting kernel runtime parameters..." - sysctl -q -p - evaluate_retval - fi - ;; - - status) - sysctl -a - ;; - - *) - echo "Usage: ${0} {start|status}" - exit 1 - ;; -esac - -exit 0 - -# End sysctl diff --git a/etc/rc.d/init.d/sysklogd b/etc/rc.d/init.d/sysklogd deleted file mode 100755 index e86b87b1..00000000 --- a/etc/rc.d/init.d/sysklogd +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin sysklogd -# -# Description : Sysklogd loader -# -# Authors : Gerard Beekmans - [email protected] -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# -# Version : LFS 7.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: $syslog -# Required-Start: $first localnet -# Should-Start: -# Required-Stop: $local_fs -# Should-Stop: sendsignals -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Starts kernel and system log daemons. -# Description: Starts kernel and system log daemons. -# /etc/fstab. -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions - -case "${1}" in - start) - log_info_msg "Starting system log daemon..." - parms=${SYSKLOGD_PARMS-'-m 0'} - start_daemon /sbin/syslogd $parms - evaluate_retval - - log_info_msg "Starting kernel log daemon..." - start_daemon /sbin/klogd - evaluate_retval - ;; - - stop) - log_info_msg "Stopping kernel log daemon..." - killproc /sbin/klogd - evaluate_retval - - log_info_msg "Stopping system log daemon..." - killproc /sbin/syslogd - evaluate_retval - ;; - - reload) - log_info_msg "Reloading system log daemon config file..." - pid=`pidofproc syslogd` - kill -HUP "${pid}" - evaluate_retval - ;; - - restart) - ${0} stop - sleep 1 - ${0} start - ;; - - status) - statusproc /sbin/syslogd - statusproc klogd - ;; - - *) - echo "Usage: ${0} {start|stop|reload|restart|status}" - exit 1 - ;; -esac - -exit 0 - -# End sysklogd diff --git a/etc/rc.d/init.d/template b/etc/rc.d/init.d/template deleted file mode 100755 index 4b3c4642..00000000 --- a/etc/rc.d/init.d/template +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin scriptname -# -# Description : -# -# Authors : -# -# Version : LFS x.x -# -# Notes : -# -######################################################################## - -### BEGIN INIT INFO -# Provides: template -# Required-Start: -# Should-Start: -# Required-Stop: -# Should-Stop: -# Default-Start: -# Default-Stop: -# Short-Description: -# Description: -# X-LFS-Provided-By: -### END INIT INFO - -. /lib/lsb/init-functions - -case "${1}" in - start) - log_info_msg "Starting..." - # if it is possible to use start_daemon - start_daemon fully_qualified_path - # if it is not possible to use start_daemon - # (command to start the daemon is not simple enough) - if ! pidofproc daemon_name_as_reported_by_ps >/dev/null; then - command_to_start_the_service - fi - evaluate_retval - ;; - - stop) - log_info_msg "Stopping..." - # if it is possible to use killproc - killproc fully_qualified_path - # if it is not possible to use killproc - # (the daemon shouldn't be stopped by killing it) - if pidofproc daemon_name_as_reported_by_ps >/dev/null; then - command_to_stop_the_service - fi - evaluate_retval - ;; - - restart) - ${0} stop - sleep 1 - ${0} start - ;; - - *) - echo "Usage: ${0} {start|stop|restart}" - exit 1 - ;; -esac - -exit 0 - -# End scriptname diff --git a/etc/rc.d/init.d/tlp b/etc/rc.d/init.d/tlp deleted file mode 100755 index 6c5f9a7c..00000000 --- a/etc/rc.d/init.d/tlp +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -. /lib/lsb/init-functions - -case "${1}" in - start) - log_info_msg "Starting tlp..." - if ! pidofproc daemon_name_as_reported_by_ps >/dev/null; then - /usr/sbin/tlp init start - fi - evaluate_retval - ;; - - stop) - log_info_msg "Stopping..." - if pidofproc daemon_name_as_reported_by_ps >/dev/null; then - /usr/sbin/tlp init stop - fi - evaluate_retval - ;; - - restart) - ${0} stop - sleep 1 - ${0} start - ;; - - *) - echo "Usage: ${0} {start|stop|restart}" - exit 1 - ;; -esac - -exit 0 diff --git a/etc/rc.d/init.d/udev b/etc/rc.d/init.d/udev deleted file mode 100755 index f3b07b02..00000000 --- a/etc/rc.d/init.d/udev +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin udev -# -# Description : Udev cold-plugging script -# -# Authors : Zack Winkles, Alexander E. Patrakov -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# Xi Ruoyao - [email protected] -# -# Version : LFS 12.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: udev $time -# Required-Start: localnet -# Should-Start: modules -# Required-Stop: -# Should-Stop: -# Default-Start: S -# Default-Stop: -# Short-Description: Populates /dev with device nodes. -# Description: Mounts a tempfs on /dev and starts the udevd daemon. -# Device nodes are created as defined by udev. -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions - -case "${1}" in - start) - log_info_msg "Populating /dev with device nodes... " - if ! grep -q '[[:space:]]sysfs' /proc/mounts; then - log_failure_msg2 - msg="FAILURE:\n\nUnable to create " - msg="${msg}devices without a SysFS filesystem\n\n" - msg="${msg}After you press Enter, this system " - msg="${msg}will be halted and powered off.\n\n" - log_info_msg "$msg" - log_info_msg "Press Enter to continue..." - wait_for_user - /etc/rc.d/init.d/halt stop - fi - - # Start the udev daemon to continually watch for, and act on, - # uevents - SYSTEMD_LOG_TARGET=kmsg /sbin/udevd --daemon - - # Now traverse /sys in order to "coldplug" devices that have - # already been discovered - /bin/udevadm trigger --action=add --type=subsystems - /bin/udevadm trigger --action=add --type=devices - /bin/udevadm trigger --action=change --type=devices - - # Now wait for udevd to process the uevents we triggered - if ! is_true "$OMIT_UDEV_SETTLE"; then - /bin/udevadm settle - fi - - # If any LVM based partitions are on the system, ensure they - # are activated so they can be used. - if [ -x /sbin/vgchange ]; then /sbin/vgchange -a y >/dev/null; fi - - log_success_msg2 - ;; - - *) - echo "Usage ${0} {start}" - exit 1 - ;; -esac - -exit 0 - -# End udev diff --git a/etc/rc.d/init.d/udev_retry b/etc/rc.d/init.d/udev_retry deleted file mode 100755 index ccac9a2b..00000000 --- a/etc/rc.d/init.d/udev_retry +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin udev_retry -# -# Description : Udev cold-plugging script (retry) -# -# Authors : Alexander E. Patrakov -# DJ Lucas - [email protected] -# Update : Bruce Dubbs - [email protected] -# Bryan Kadzban - -# -# Version : LFS 7.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: udev_retry -# Required-Start: udev -# Should-Start: $local_fs cleanfs -# Required-Stop: -# Should-Stop: -# Default-Start: S -# Default-Stop: -# Short-Description: Replays failed uevents and creates additional devices. -# Description: Replays any failed uevents that were skipped due to -# slow hardware initialization, and creates those needed -# device nodes -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions - -case "${1}" in - start) - log_info_msg "Retrying failed uevents, if any..." - - rundir=/run/udev - # From Debian: "copy the rules generated before / was mounted - # read-write": - - for file in ${rundir}/tmp-rules--*; do - dest=${file##*tmp-rules--} - [ "$dest" = '*' ] && break - cat $file >> /etc/udev/rules.d/$dest - rm -f $file - done - - # Re-trigger the uevents that may have failed, - # in hope they will succeed now - /bin/sed -e 's/#.*$//' /etc/sysconfig/udev_retry | /bin/grep -v '^$' | \ - while read line ; do - for subsystem in $line ; do - /bin/udevadm trigger --subsystem-match=$subsystem --action=add - done - done - - # Now wait for udevd to process the uevents we triggered - if ! is_true "$OMIT_UDEV_RETRY_SETTLE"; then - /bin/udevadm settle - fi - - evaluate_retval - ;; - - *) - echo "Usage ${0} {start}" - exit 1 - ;; -esac - -exit 0 - -# End udev_retry diff --git a/etc/rc.d/init.d/wpa_supplicant b/etc/rc.d/init.d/wpa_supplicant deleted file mode 100755 index daa62ca3..00000000 --- a/etc/rc.d/init.d/wpa_supplicant +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -. /lib/lsb/init-functions - -case "${1}" in - start) - log_info_msg "Starting wpa_supplicant..." - start_daemon /sbin/wpa_supplicant -B -i eth0 -c /etc/wpa_supplicant/wpa_supplicant.conf - evaluate_retval - ;; - - stop) - log_info_msg "Stopping wpa_supplicant..." - killproc /sbin/wpa_supplicant - evaluate_retval - ;; - - restart) - ${0} stop - sleep 1 - ${0} start - ;; - - *) - echo "Usage: ${0} {start|stop|restart}" - exit 1 - ;; -esac - -exit 0 |