2 # Begin $rc_base/init.d/rc - Main Run Level Control Script
4 # Based on rc script from LFS-3.1 and earlier.
5 # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
7 # Modified to use variables below, instead of rc*.d directories with
8 # symbolic links by Neven Has - haski@sezampro.yu
11 # Additional user scripts, not part of the base LFS.
21 STOP
[0]="${ADD[3]} ${ADD[7]} sysklogd sendsignals mountfs swap localnet halt"
34 START
[3]="sysklogd ${ADD[3]}"
45 STOP
[6]="${ADD[3]} ${ADD[7]} sysklogd sendsignals mountfs swap localnet reboot"
50 START
[7]="swap mountproc checkfs mountfs cleanfs setclock loadkeys localnet \
54 # There is probably a much better way to do this.
56 for i
in $2 ; do if [ $i = $1 ] ; then return 1 ; fi ; done
60 source /etc
/sysconfig
/rc
65 [ "$1" != "" ] && runlevel
=$1
67 if [ "$runlevel" = "" ]
69 echo "Usage: $0 <runlevel>" >&2
72 elif [ $runlevel = sysinit
]
78 [ "$previous" = "" ] && previous
=N
80 if [ "$previous" != "N" ]
82 for i
in ${STOP[$runlevel]}
84 script=$rc_base/init.d
/$i
89 echo "$script is not executable, skipping"
93 if [ "$runlevel" != "0" ] && [ "$runlevel" != "6" ]
95 if [ should_skip
$i ${START[$previous]} ] ||
96 [ should_skip
$i ${START[7]} ]
99 echo "$i can't be executed because it was"
100 echo "not started in the previous runlevel ($previous)"
109 if [ "$error_value" != "0" ]
116 for i
in ${START[$runlevel]}
118 script=$rc_base/init.d
/$i
120 if [ "$previous" != "N" ]
122 if [ should_skip
$i ${START[$previous]} ] ||
123 [ should_skip
$i ${STOP[$runlevel]} ]
129 # check_script_status
132 echo "$script is not executable, skipping"
139 if [ "$error_value" != "0" ]
145 # End $rc_base/init.d/rc