merging rc and rcS?
jjones at darkside.dynup.net
Tue Jul 31 18:04:28 PDT 2001
On Tue, Jul 31, 2001 at 08:01:49PM -0400, Gerard Beekmans wrote:
> Do we really need a seperate rc and rcS script? We could treat rcS as
> what it is: runlevel S, so calling 'rc S' would run all scripts in
> /etc/rcS.d just like 'rc x' would call scripts in /etc/rcx.d (where x is
> a number between 0 and 6).
> I really cannot remember anymore why once upon a time (back in 1998 when
> LFS started) I decided to have a seperate rcS script. Whatever the
> reason was at that time, I don't think it was any solid reasoning.
It's quite feasible.. I've got a new rc script with the new stuff you've seen
in it working.. i was looking for you but I killed my box testing the new rc
script out. :)
I'd like you to take a look at what I have now. There are quite possibly
still some bugs in it, but it is properly starting/stopping my init scripts
Check it out.
-------------- next part --------------
# I intend to set this in /etc/init.d/functions.. we're going for flexibility
# here aren't we? ;)
# Uncomment below for debugging.
case "$1" in
*.sh) $debug sh "$@" ;;
*) $debug "$@" ;;
if [ "$?" != 0 ]; then
echo -n "You should not see this message. It means that an "
echo "unforseen error "
echo -n "occured and the subscript, $i, exited with a return "
echo "value of $error_value for an unknown reason."
echo "Press enter to continue"
trap ":" INT QUIT TSTP
[ "$1" != "" ] && runlevel=$1 || runlevel=$RUNLEVEL
if [ "$runlevel" = "" ]; then
echo "Usage: $0 <runlevel>" >&2
[ "$PREVLEVEL" = "" ] && previous=N || previous=$PREVLEVEL
export runlevel previous
if [ -d $rc_path ]; then
for i in `ls K* S* 2>/dev/null | sed \
's/^\([S|K]\)\(.*[0-9]\)\(.*\)/\1\2-\3/' | sort -g`
eval `echo $i | sed 's/^[S|K]\(.*[0-9]\)-\(.*\)/suffix=\1\2/'`
if [ "$prevlevel" != "N" -a ! -f $start -a -f $stop ]; then
startup $stop stop
if [ ! -f $previous_start -a ! -f $stop -a -f $start ]; then
startup $start start
More information about the lfs-dev