Subject: Re: Changing root's shell to /bin/sh
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Simon J. Gerraty <sjg@quick.com.au>
List: current-users
Date: 03/18/1999 23:47:07
>Jay Maynard has done that. We dont need to copy the filename-ordering,
>but the split itself might well be useful. and we can rework /etc/rc
>to just call all the modules (or "rc.<whatever> start" scripts in
>more-or-less the existing order as rc does it now.

Done that already - years ago so its out of date.
But the rc engine etc exists and has been offered before.
ftp://ftp.quick.com.au:/pub/unix/rc.sh

btw that script would have been much simpler if basename and 
dirname were in /bin :-)

My /etc/rc is:

:
# make sure autoboot arg does not confuse rc.sh
# WARNING: -e option tells rc.sh to bail out if any of the S*
# scripts exit non-zero.  Ending such a script with test foo && xyz
# will cause boot to fail if foo is not true.
exec /etc/rc.sh -e /etc/rc.d:S:$1

My NetBSD systems have been using this since 1994.
The same script (rc.sh) is used to implement /etc/rc_local.d on all
sorts of systems and /etc/{daily,hourly,weekly,monthly,...} too.
Makes for a _lot_ of code re-use.

Yes the Sxxx naming stuff may be ugly - though has never seemed a 
problem.  But if you _really_ want a .depend file for /etc/rc.d 
then my dnsdeps scripts (I use make and cvs to control DNS zone file
serial numbers :-) could probably be hacked to do the trick.

--sjg