3 # single Script for sedding up administrative/rescue shell.
6 # description: This file is executed by init when it goes into runlevel \
7 # 1, which is the administrative state. It kills all \
8 # deamons and then puts the system into single user mode. \
9 # Note that the file systems are kept mounted. \
11 # Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
12 # Modified for PLD Linux by Grzegorz Stanislawski
13 # Changes: Arkadiusz Mi¶kiewicz <misiek@pld.org.pl>
17 PATH=/sbin:/bin:/usr/sbin:/usr/bin
19 . /etc/rc.d/init.d/functions
27 [ "${BASH+bash}" = bash ] && enable kill
29 show "Sending all processes the TERM signal "
32 show "Sending all processes the KILL signal "
35 rm -f /var/lock/subsys/*
38 [ -x /usr/bin/clear ] && /usr/bin/clear
40 # make sure modprobe is working
41 if [ -f /proc/sys/kernel/modprobe ]; then
42 echo "/sbin/modprobe" > /proc/sys/kernel/modprobe
45 # If they want to run something in single user mode, might as well run it...
46 for i in /etc/rc.d/rc1.d/S[0-9][0-9]*; do
47 # Check if the script is there.
48 [ ! -f $i ] && continue
50 # Don't run [KS]??foo.{rpmsave,rpmorig} scripts
51 [ "${i%.rpmsave}" != "${i}" ] && continue
52 [ "${i%.rpmorig}" != "${i}" ] && continue
53 [ "${i%.rpmnew}" != "${i}" ] && continue
54 [ "$i" = "/etc/rc.d/rc1.d/S00single" ] && continue
58 # Now go to the single user level.
59 show "Telling INIT to go to single user mode"; ok