3 # rcS Call all S??* scripts in /etc/rcS.d in
4 # numerical/alphabetical order.
6 # Version: @(#)/etc/init.d/rcS 2.76 19-Apr-1999 miquels@cistron.nl
9 PATH=/sbin:/bin:/usr/sbin:/usr/bin
13 export PATH runlevel prevlevel
15 # Make sure proc is mounted
17 [ -d "/proc/1" ] || mount /proc
20 # See if system needs to be setup. This is ONLY meant to
21 # be used for the initial setup after a fresh installation!
23 if [ -x /sbin/unconfigured.sh ]
34 # Trap CTRL-C &c only in this shell so we can interrupt subprocesses.
36 trap ":" INT QUIT TSTP
39 # Do we have /proc/progress and set VERBOSE to "no" ?
40 # If so, calculate the number of scripts and the incremental step
43 # HACK: progress needs LCD to create /proc device entry
46 if [ "$VERBOSE" = no ]; then
47 if [ -e /proc/progress ]; then
48 set `ls -1 /etc/rc$runlevel.d/S* | wc`
50 # bootup, the first script, increments until 25.
51 # the userspace then picks up at 50
52 PROGRESS_incstep=`expr 25 / $1`
55 export PROGRESS_value PROGRESS_incstep
58 export VERBOSE PROGRESS
61 # Call all parts in order.
63 for i in /etc/rcS.d/S??*
65 # Ignore dangling symlinks for now.
66 [ ! -f "$i" ] && continue
69 [ "$VERBOSE" = very ] && echo "INIT: Running $i..."
70 if [ "$PROGRESS" = yes ]; then
71 export PROGRESS_value=`expr $PROGRESS_value + $PROGRESS_incstep`
72 echo "$PROGRESS_value Starting $i..." >/proc/progress
77 # Source shell script for speed.
85 # No sh extension, so fork subprocess.
91 # Report status based on result code
94 if [ "$PROGRESS" = yes ]; then
95 if [ "$result" = 0 ]; then
96 echo "=s" >/proc/progress
98 echo "=f" >/proc/progress
104 # For compatibility, run the files in /etc/rc.boot too.
106 [ -d /etc/rc.boot ] && run-parts /etc/rc.boot
109 # Finish setup if needed. The comment above about
110 # /sbin/unconfigured.sh applies here as well!
112 if [ -x /sbin/setup.sh ]