aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d
diff options
context:
space:
mode:
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-xrc.d/init.d/halt213
-rwxr-xr-xrc.d/init.d/killall35
-rwxr-xr-xrc.d/init.d/netfs187
-rwxr-xr-xrc.d/init.d/single24
4 files changed, 0 insertions, 459 deletions
diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt
deleted file mode 100755
index 8b990791..00000000
--- a/rc.d/init.d/halt
+++ /dev/null
@@ -1,213 +0,0 @@
-#!/bin/bash
-#
-# halt This file is executed by init when it goes into runlevel
-# 0 (halt) or runlevel 6 (reboot). It kills all processes,
-# unmounts file systems and then either halts or reboots.
-#
-# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
-# Modified for RHS Linux by Damien Neil
-#
-
-NOLOCALE=1
-. /etc/init.d/functions
-
-UMOUNT="umount"
-[ ! -w /etc ] && UMOUNT="umount -n"
-
-halt_crypto() {
- fnval=0
- while read dst src key; do
- [ -z "$dst" -o "${dst#\#}" != "$dst" ] && continue
- if [ -b "/dev/mapper/$dst" ]; then
- if /sbin/dmsetup info "$dst" | grep -q '^Open count: *0$'; then
- action $"Stopping disk encryption for $dst" /sbin/cryptsetup remove "$dst"
- else
- fnval=1
- fi
- fi
- done < /etc/crypttab
- return $fnval
-}
-
-kill_all() {
- local STRING rc
-
- STRING=$1
- echo -n "$STRING "
- shift
- /sbin/killall5 "$@"
- rc=$?
- # Retval: 0: success 1: error 2: no processes found to kill
- if [ "$rc" == 1 ]; then
- failure $"$STRING"
- else
- success $"$STRING"
- fi
- echo
- return $rc
-}
-
-# See how we were called.
-case "$0" in
- *halt)
- message=$"Halting system..."
- command="/sbin/halt"
- ;;
- *reboot)
- message=$"Please stand by while rebooting the system..."
- command="/sbin/reboot"
- kexec_command="/sbin/kexec"
- ;;
- *)
- echo $"$0: call me as 'halt' or 'reboot' please!"
- exit 1
- ;;
-esac
-case "$1" in
- *start)
- ;;
- *)
- echo $"Usage: $0 {start}"
- exit 1
- ;;
-esac
-
-# Kill all processes.
-[ "${BASH+bash}" = bash ] && enable kill
-
-# Find mdmon pid's and omit killing them
-OMITARGS=
-for i in /dev/md/*.pid; do
- if [ ! -r "$i" ]; then
- continue
- fi
- OMITARGS="$OMITARGS -o $(cat $i)"
-done
-
-kill_all $"Sending all processes the TERM signal..." -15 $OMITARGS
-# No need to sleep and kill -9 if no processes to kill were found
-if [ "$?" == 0 ]; then
- sleep 2
- kill_all $"Sending all processes the KILL signal..." -9 $OMITARGS
-fi
-
-# Write to wtmp file before unmounting /var
-/sbin/halt -w
-
-# Save mixer settings, here for lack of a better place.
-if [ -s /etc/alsa/alsactl.conf ] && [ -x /sbin/alsactl ] && [ -w /etc/asound.state ]; then
- action $"Saving mixer settings" /sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --ignore store
-fi
-
-# Save random seed
-touch /var/lib/random-seed
-chmod 600 /var/lib/random-seed
-action $"Saving random seed: " dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=512 2>/dev/null
-
-[ -x /sbin/hwclock ] && action $"Syncing hardware clock to system time" /sbin/hwclock --systohc
-
-# Try to unmount tmpfs filesystems to avoid swapping them in. Ignore failures.
-tmpfs=$(awk '$2 ~ /^\/($|proc|dev)/ { next; }
- $3 == "tmpfs" { print $2; }' /proc/mounts | sort -r)
-[ -n "$tmpfs" ] && fstab-decode $UMOUNT $tmpfs 2>/dev/null
-
-# Turn off swap, then unmount file systems.
-[ -f /proc/swaps ] && SWAPS=$(awk '! /^Filename/ { print $1 }' /proc/swaps)
-if [ -n "$SWAPS" ]; then
- action $"Turning off swap: " swapoff $SWAPS
- for dst in $SWAPS; do
- if [[ "$dst" == /dev/mapper* ]] \
- && [ "$(dmsetup status "$dst" | cut -d ' ' -f 3)" = crypt ]; then
- backdev=$(/sbin/cryptsetup status "$dst" \
- | awk '$1 == "device:" { print $2 }')
- /sbin/cryptsetup remove "$dst"
- fi
- done
-fi
-
-[ -x /sbin/quotaoff ] && action $"Turning off quotas: " /sbin/quotaoff -aug
-
-# Unmount file systems, killing processes if we have to.
-# Unmount loopback stuff first
-__umount_loopback_loop
-
-# Unmount RPC pipe file systems
-__umount_loop '$3 ~ /^rpc_pipefs$/ || $3 ~ /^rpc_svc_gss_pipefs$/ {print $2}' \
- /proc/mounts \
- $"Unmounting pipe file systems: " \
- $"Unmounting pipe file systems (retry): " \
- -f
-
-LANG=C __umount_loop '$2 ~ /^\/$|^\/proc|^\/cgroup|^\/sys\/fs\/cgroup|^\/dev/{next}
- $3 == "tmpfs" || $3 == "proc" {print $2 ; next}
- $3 ~ /(loopfs|autofs|nfs|cifs|smbfs|ncpfs|sysfs)/ {next}
- /(^none|^\/dev\/ram|^\/dev\/root$)/ {next}
- {print $2}' /proc/mounts \
- $"Unmounting file systems: " \
- $"Unmounting file systems (retry): " \
- -f
-
-[ -f /proc/bus/usb/devices ] && $UMOUNT /proc/bus/usb
-
-[ -f /etc/crypttab ] && halt_crypto
-
-# remove the crash indicator flag
-rm -f /.autofsck
-
-# Try all file systems other than root, essential filesystems and RAM disks,
-# one last time.
-awk '$2 !~ /\/(|dev|proc|selinux|cgroup|sys)$/ && $1 !~ /(^\/dev\/ram|cgroup)/ { print $2 }' \
- /proc/mounts | sort -r | \
- while read line; do
- fstab-decode $UMOUNT -f $line
-done
-
-if [ -x /sbin/halt.local ]; then
- /sbin/halt.local
-fi
-
-# Tell init to re-exec itself.
-kill -TERM 1
-
-# Remount read only anything that's left mounted.
-# echo $"Remounting remaining filesystems readonly"
-mount | awk '{ print $1,$3 }' | while read dev dir; do
- fstab-decode mount -n -o ro,remount $dev $dir
-done
-
-# If we left mdmon's running wait for the raidsets to become clean
-if [ -n "$OMITARGS" ]; then
- mdadm --wait-clean --scan
-fi
-
-# Now halt or reboot.
-echo $"$message"
-if [ -f /fastboot ]; then
- echo $"On the next boot fsck will be skipped."
-elif [ -f /forcefsck ]; then
- echo $"On the next boot fsck will be forced."
-fi
-
-# Shutdown UPS drivers
-if [ "$command" = /sbin/halt ] && [ -f /etc/sysconfig/ups ]; then
- . /etc/sysconfig/ups
- if [ -z $POWERDOWNFLAG ]; then
- POWERDOWNFLAG=/etc/killpower
- fi
- if [ "$SERVER" = "yes" ] && [ -f $POWERDOWNFLAG ]; then
- /sbin/upsdrvctl shutdown
- fi
-fi
-
-# Turn off UPS in powerfail situation
-if [ -x /etc/apcupsd/apccontrol -a -f /etc/apcupsd/powerfail ]; then
- /etc/apcupsd/apccontrol killpower
-fi
-
-# First, try kexec. If that fails, fall back to rebooting the old way.
-[ -n "$kexec_command" ] && $kexec_command -e -x >& /dev/null
-
-HALTARGS="-d"
-[ "$INIT_HALT" != "HALT" ] && HALTARGS="$HALTARGS -p"
-
-exec $command $HALTARGS
diff --git a/rc.d/init.d/killall b/rc.d/init.d/killall
deleted file mode 100755
index 4405879c..00000000
--- a/rc.d/init.d/killall
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /bin/bash
-
-# Bring down all unneeded services that are still running (there shouldn't
-# be any, so this is just a sanity check)
-
-case "$1" in
- *start)
- ;;
- *)
- echo $"Usage: $0 {start}"
- exit 1
- ;;
-esac
-
-
-for i in /var/lock/subsys/* ; do
- # Check if the script is there.
- [ -f "$i" ] || continue
-
- # Get the subsystem name.
- subsys=${i#/var/lock/subsys/}
-
- # Networking could be needed for NFS root.
- [ $subsys = network ] && continue
-
- # Bring the subsystem down.
- if [ -f /etc/init.d/$subsys ]; then
- /etc/init.d/$subsys stop
- elif [ -f /etc/init.d/$subsys.init ]; then
- /etc/init.d/$subsys.init stop
- else
- rm -f "$i"
- fi
-done
-exit 0
diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs
deleted file mode 100755
index a1bc022a..00000000
--- a/rc.d/init.d/netfs
+++ /dev/null
@@ -1,187 +0,0 @@
-#!/bin/bash
-#
-# netfs Mount network filesystems.
-#
-# Authors: Bill Nottingham <notting@redhat.com>
-# AJ Lewis <alewis@redhat.com>
-# Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
-#
-# chkconfig: 345 25 75
-# description: Mounts and unmounts all Network File System (NFS), \
-# CIFS (Lan Manager/Windows), and NCP (NetWare) mount points.
-### BEGIN INIT INFO
-# Provides: $remote_fs
-# Short-Description: Mount and unmount network filesystems.
-# Description: Mount and unmount network filesystems.
-# Should-Start: $network
-### END INIT INFO
-
-[ -f /etc/sysconfig/network ] || exit 0
-. /etc/init.d/functions
-. /etc/sysconfig/network
-
-NFSFSTAB=$(LC_ALL=C awk '!/^#/ && $3 ~ /^nfs/ && $3 != "nfsd" && $4 !~ /noauto/ { print $2 }' /etc/fstab)
-CIFSFSTAB=$(LC_ALL=C awk '!/^#/ && $3 == "cifs" && $4 !~ /noauto/ { print $2 }' /etc/fstab)
-NCPFSTAB=$(LC_ALL=C awk '!/^#/ && $3 == "ncpfs" && $4 !~ /noauto/ { print $2 }' /etc/fstab)
-NETDEVFSTAB=$(LC_ALL=C awk '!/^#/ && $4 ~/_netdev/ && $4 !~ /noauto/ { print $1 }' /etc/fstab)
-
-NFSMTAB=$(LC_ALL=C awk '$3 ~ /^nfs/ && $3 != "nfsd" && $2 != "/" { print $2 }' /proc/mounts)
-CIFSMTAB=$(LC_ALL=C awk '$3 == "cifs" { print $2 }' /proc/mounts | tac)
-NCPMTAB=$(LC_ALL=C awk '$3 == "ncpfs" { print $2 }' /proc/mounts | tac)
-NETDEVMTAB=$(LC_ALL=C awk '$4 ~ /_netdev/ && $2 != "/" { print $2 }' /etc/mtab)
-
-# See how we were called.
-case "$1" in
- start)
- [ ! -f /var/lock/subsys/network ] && ! nm-online -x >/dev/null 2>&1 && exit 0
- [ "$EUID" != "0" ] && exit 4
- [ -n "$NFSFSTAB" ] &&
- {
- [ ! -f /var/lock/subsys/rpcbind ] && service rpcbind start
- action $"Mounting NFS filesystems: " mount -a -t nfs,nfs4
- }
- [ -n "$CIFSFSTAB" ] && action $"Mounting CIFS filesystems: " mount -a -t cifs
- [ -n "$NCPFSTAB" ] && action $"Mounting NCP filesystems: " mount -a -t ncpfs
- [ -n "$NETDEVFSTAB" ] &&
- {
- if [ -f /etc/mdadm.conf ] && [ -x /sbin/mdadm ]; then
- /sbin/mdadm -A -s
- fi
- if [ -f /etc/multipath.conf ] && [ -x /sbin/multipath ]; then
- modprobe dm-multipath >/dev/null 2>&1
- /sbin/multipath -u -v 0
- if [ -x /sbin/kpartx ]; then
- /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -u -a -p p"
- fi
- fi
- if [ -x /sbin/lvm ]; then
- if /sbin/lvm vgscan > /dev/null 2>&1 ; then
- action $"Setting up Logical Volume Management:" /sbin/lvm vgchange -a y
- fi
- fi
-
- if [ -f /etc/crypttab ]; then
- init_crypto 1
- fi
-
- STRING=$"Checking network-attached filesystems"
-
- echo $STRING
- fsck -A -T -M -a -t opts=_netdev
- rc=$?
-
- if [ "$rc" -eq "0" ]; then
- success "$STRING"
- echo
- elif [ "$rc" -eq "1" ]; then
- passed "$STRING"
- echo
- fi
-
- if [ "$rc" -gt 1 ]; then
- if [ -x /bin/plymouth ] && /bin/plymouth --ping ; then
- /bin/plymouth --hide-splash
- fi
- failure "$STRING"
- tty >/dev/null 2>&1 || exit 1
- echo
- echo
- echo $"*** An error occurred during the file system check."
- echo $"*** Dropping you to a shell; the system will reboot"
- echo $"*** when you leave the shell."
-
- str=$"(Repair filesystem)"
- PS1="$str \# # "; export PS1
- [ "$SELINUX" = "1" ] && disable_selinux
- sulogin
-
- shutdown -r now
- fi
- }
- touch /var/lock/subsys/netfs
- # The 'no' applies to all listed filesystem types. See mount(8).
- action $"Mounting other filesystems: " mount -a -t nonfs,nfs4,cifs,ncpfs,gfs2
- ;;
- stop)
- # Unmount loopback stuff first
- [ "$EUID" != "0" ] && exit 4
- __umount_loopback_loop
- if [ -n "$NETDEVMTAB" ]; then
- __umount_loop '$4 ~ /_netdev/ && $2 != "/" {print $2}' \
- /etc/mtab \
- $"Unmounting network block filesystems: " \
- $"Unmounting network block filesystems (retry): "
- fi
- if [ -n "$NFSMTAB" ]; then
- __umount_loop '$3 ~ /^nfs/ && $3 != "nfsd" && $2 != "/" {print $2}' \
- /proc/mounts \
- $"Unmounting NFS filesystems: " \
- $"Unmounting NFS filesystems (retry): " \
- "-f -l"
- fi
- if [ -n "$CIFSMTAB" ]; then
- for MNT in $CIFSMTAB; do
- action $"Unmounting CIFS filesystem: $MNT" umount "$MNT"
- done
- fi
- if [ -n "$NCPMTAB" ]; then
- for MNT in $NCPMTAB; do
- action $"Unmounting NCP filesystem: $MNT" umount "$MNT"
- done
- fi
- rm -f /var/lock/subsys/netfs
- ;;
- status)
- if [ -f /proc/mounts ] ; then
- [ -n "$NFSFSTAB" ] && {
- echo $"Configured NFS mountpoints: "
- for fs in $NFSFSTAB; do echo $fs ; done
- }
- [ -n "$CIFSFSTAB" ] && {
- echo $"Configured CIFS mountpoints: "
- for fs in $CIFSFSTAB; do echo $fs ; done
- }
- [ -n "$NCPFSTAB" ] && {
- echo $"Configured NCP mountpoints: "
- for fs in $NCPFSTAB; do echo $fs ; done
- }
- [ -n "$NETDEVFSTAB" ] && {
- echo $"Configured network block devices: "
- for fs in $NETDEVFSTAB; do echo $fs ; done
- }
- [ -n "$NFSMTAB" ] && {
- echo $"Active NFS mountpoints: "
- for fs in $NFSMTAB; do echo $fs ; done
- }
- [ -n "$CIFSMTAB" ] && {
- echo $"Active CIFS mountpoints: "
- for fs in $CIFSMTAB; do echo $fs ; done
- }
- [ -n "$NCPMTAB" ] && {
- echo $"Active NCP mountpoints: "
- for fs in $NCPMTAB; do echo $fs ; done
- }
- [ -n "$NETDEVMTAB" ] && {
- echo $"Active network block devices: "
- for fs in $NETDEVMTAB; do echo $fs ; done
- }
- else
- echo $"/proc filesystem unavailable"
- fi
- [ -r /var/lock/subsys/netfs ] || exit 3
- ;;
- restart)
- $0 stop
- $0 start
- exit $?
- ;;
- reload)
- $0 start
- exit $?
- ;;
- *)
- echo $"Usage: $0 {start|stop|restart|reload|status}"
- exit 2
-esac
-
-exit 0
diff --git a/rc.d/init.d/single b/rc.d/init.d/single
deleted file mode 100755
index 0ae9268e..00000000
--- a/rc.d/init.d/single
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-#
-#
-# rc.single This file is executed by init when it goes into runlevel
-# 1, which is the administrative state. It kills all
-# deamons and then puts the system into single user mode.
-# Note that the file systems are kept mounted.
-#
-# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
-# Modified for RHS Linux by Damien Neil
-#
-
-. /etc/init.d/functions
-
-if [ "$1" != "start" ]; then
- exit 0
-fi
-
-# this looks nicer
-[ -x /usr/bin/clear ] && /usr/bin/clear
-
-# Now go to the single user level.
-echo $"Telling INIT to go to single user mode."
-exec init -t1 S