[Bug 35] rc and rcS file may need updating

Gerard Beekmans gerard at linuxfromscratch.org
Fri May 11 17:40:34 PDT 2001

On Fri, May 11, 2001 at 12:02:44PM -0400, Simon Perreault wrote:
> On Friday 11 May 2001 11:55, you wrote:
> > What do you mean? If you mean if I'm sure whether or not the scripts
> > will be called in sequence (starting at 100, up to 999), then yes I'm
> > sure.
> Fine, it's just that I couldn't determine that by looking at the script.

Having given rcS a more thorough look today and compared with rc, I
noticed a little other thing.

rc uses:
for i in /etc/rc$runlevel.d/S*
	[ ! -f $i ] && continue
 	if [ $previous != N ]
	<the rest here>

The [0-9][0-9][0-9] are only used to construct the 
sysinit_start, previous_start and previous_stop variables. The actual
running of the script is just $i stop or $i start that's constructed
from a "for in S*" or "for in in K*" and it lets bash sort the scripts
in numeric order.

So, the change to rcS was not from S?? to S[0-9][0-9][0-9], but should
have been from S?? to S*

Nice, eh? As i'm redoing the network scripts I'll have a closer look at
our master scripts (rc and rcS). It seems that there's quite a bit of
stuff in there that can be changed, made easier, etc.

Sorry for the confusion, I'll reopen the bug, update book and close it,
so this change will be logged there.

I hope I'm doing the right thing by changing it to S*. 

Let's run a test. The old way:
gerard:/etc/rcS.d$ for i in S??*; do echo $i; done

The new way:
gerard:/etc/rcS.d$ for i in S*; do echo $i; done

There's no checking if the S (or K's) is preceded by three numbers, but there's
no real check in rc either. It'll be fixed up soon. 

Gerard Beekmans

-*- If Linux doesn't have the solution, you have the wrong problem -*-

More information about the lfs-book mailing list