On Tue, Jan 23, 2001 at 10:18:53AM -0800, Ian Zimmerman wrote:
> 
> Karsten> S is single user.  Same as '1'.
> 
> This is not quite right.
> 
> S is the real single-user level.  1 OTOH is used just as a way-station

not quite, S is for script that need to be run once per boot.  its run
on boot regardless of what runlevel will be entered.  things like
reading the hardware clock, mounting filesystems and such need not be
done on runlevel changes (even multi -> single and back).  

> from multiuser to kill all the multiuser services before entering S
> with clean slate.  If you say "init S" in multiuser you will end up
> with a root password prompt because all the getties will be killed
> (being under direct control of init), but the services will stay up.

init S == init 1

> If you look at /etc/init.d/rcS (the script that init executes when
> entering S) you'll see that _all_ the sub-scripts in /etc/rcS.d/ are
> run with "start" as a parameter - which means rcS _never_ kills
> anything.  If you do "init 1" /etc/init.d/rc is run instead, which
> knows how to kill the services by calling sub-scripts with a "stop"
> parameter.  The last sub-script then does "init S".
> 
> I don't know why it is done this way; it looks like an ugly hack to
> me.  I'd just have rcS work the same way as rc (indeed they should be
> the same script).  Ask me when I am a developer :)

its done this way so that its simple to add something to the `must be
run at boot once' list of things to do.  without it you would have to
edit the main initscript /etc/init.d/rc.  (which a debian package
can't do without violating policy.)  the rcS.d is basically the
equivilent of redhat's rc.local.  redhat has all the `once at boot'
stuff crammed into a much more bloated /etc/rc script, which runs
rc.local for anything packages or the admin needs added.  very messy.
rcS.d is far cleaner and simpler.  

-- 
Ethan Benson
http://www.alaska.net/~erbenson/

Attachment: pgpq8CN1tlcX8.pgp
Description: PGP signature

Reply via email to