Subject: Re: The new rc.d stuff...
To: John Nemeth <>
From: Andrew Brown <>
List: current-users
Date: 04/24/2000 00:37:55
> 0) halted	(shutdown -h or halt, wait for "press any key...")
> 1) single user	(kill 1 or boot -s)
> 3) multi user	(a normal boot scenario)
> 5) power down	(shutdown -p or halt -p, for systems that support it)
> 6) rebooting	(shutdown -r or reboot)
>these are all discrete run-levels (as above) in solaris.  they just
>don't have the numbers associated with them in netbsd.  solaris also
>has 2 (like 3, but without nfs), 4 (and alternate 3), q or Q (which is
>the same as kill -1 1), and s or S (which looks very similar to 1).
>the only other thing solaris does is have *other* jobs that run at the
>various init levels that are started (or stopped) via inittab when at
>a specific run-level.

i thought about it a bit on the way to dinner and came up with this:

 (1) add a kernel variable (and a sysctl) call kern.runlevel which is
     a string that can only be updated by init.

 (2) add support to init for programs (only those with superuser
     privileges) to tell init to which to a different run level.  a
     named pipe called /etc/initpipe with the appropriate permissions
     would probably do fine.

 (3) add support in shutdown(8) for "shutdown -i<foo>" where foo
     simply refers to an entry in a file called /etc/inittab (for lack
     of a better name).  shutdown notifies init of the new run level,
     init makes a note of it in the kernel, and (forks and) execs "sh
     -c <command>" where command is taken from the inittab file.

 (4) add support to who(1) for "who -r" which reports the current run


oh, and this is *completely* ignorable by anyone who doesn't wish to
use it.

(andrew now ducks and runs for cover :)

|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."