]> git.pld-linux.org Git - projects/rc-scripts.git/blob - rc.d/init.d/single
- removed inputrc (it must be in readline),
[projects/rc-scripts.git] / rc.d / init.d / single
1 #!/bin/sh
2 #
3 # single        Script for sedding up administrative/rescue shell.
4 #
5 # chkconfig: 1 00 00
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. \
10 #
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>
14 #
15
16 # Set the path.
17 PATH=/sbin:/bin:/usr/sbin:/usr/bin
18
19 . /etc/rc.d/init.d/functions
20
21 case "$1" in
22    stop*)
23         exit 0
24         ;;
25    start*)
26 # Kill all processes.
27         [ "${BASH+bash}" = bash ] && enable kill
28
29         show "Sending all processes the TERM signal "
30         daemon killall5 -15
31         sleep 5
32         show "Sending all processes the KILL signal "
33         daemon killall5 -9
34
35         rm -f /var/lock/subsys/*
36
37         # this looks nices
38         [ -x /usr/bin/clear ] && /usr/bin/clear
39
40 # make sure modprobe is working
41 if [ -f /proc/sys/kernel/modprobe ]; then
42         echo "/sbin/modprobe" > /proc/sys/kernel/modprobe
43 fi
44
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
49
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
55        $i start
56 done
57
58         # Now go to the single user level.
59         show "Telling INIT to go to single user mode"; ok
60         exec init -t1 S
61         ;;
62 esac
This page took 0.069394 seconds and 3 git commands to generate.