2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by scripts/Create-CopyPatch.
5 # T2 SDE: package/.../sysfiles/etc_rc.d_rc.txt
6 # Copyright (C) 2004 - 2020 The T2 SDE Project
7 # Copyright (C) 1998 - 2003 ROCK Linux Project
9 # More information can be found in the files COPYING and README.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; version 2 of the License. A copy of the
14 # GNU General Public License can be found in the file COPYING.
15 # --- T2-COPYRIGHT-NOTE-END ---
18 # ROCK Linux: /etc/rc.d/rc
20 # This script does the switching between runlevels.
24 export PATH
=/bin
:/sbin
:/usr
/bin
:/usr
/sbin
26 echo "** running rc script **"
27 echo "RC: Previous runlevel: $PREVLEVEL, new runlevel: $RUNLEVEL."
29 curdir
=/etc
/rc.d
/rc
$RUNLEVEL.d
30 prevdir
=/etc
/rc.d
/rc
$PREVLEVEL.d
33 # run the KILL scripts of the previous runlevel (if needed)
35 if ! [ $PREVLEVEL = S
-o $PREVLEVEL = N
]
37 echo "RC: Leave runlevel $PREVLEVEL ..."
38 for i
in $prevdir/K
*; do
39 if ! test -x "$i" ; then
40 echo "Warning: $i is not executable: skipped."
43 x
="`echo "$i" | sed "s
,$prevdir/K..
,$curdir/S??
,"`"
44 [ "`echo $x`" = "$x" ] ||
continue
45 /sbin
/rc
--nobtee $i stop
49 echo "RC: Enter runlevel $RUNLEVEL ..."
51 if [ $RUNLEVEL != 0 -a $RUNLEVEL != 6 -a $RUNLEVEL != S
]
54 # run the START scripts of the current (new) runlevel
56 for i
in $curdir/S
*; do
57 if ! test -x "$i" ; then
58 echo "Warning: $i is not executable: skipped."
62 x
="`echo "$i" | sed "s
,$curdir/S..
,$prevdir/K??
,"`"
63 [ "`echo $x`" = "$x" ] ||
continue
64 /sbin
/rc
--nobtee $i start
68 echo "RC: The system is now in runlevel $RUNLEVEL."
70 # write EOT mark for btee
73 } 2>&1 |
/sbin
/btee a
/var
/log
/init.msg