Dave Sherohman <esper at sherohman.org> writes:

> Callum Lerwick said:
> > Naw, its no buisness of the kernel. Its an init thing. If you wanted to
> > change runlevels around, I don't think init would have a problem with
> > it.
> 
> So there's something in a config file that says, "When you switch to
> runlevel X, shut the system down"?  I don't see anything that looks like
> it might have that function in either /etc/inttab or /etc/rc0.d; where would
> it be?  (And, again, I'm specifically curious about whether this could be
> done by editing config files.  Touching the source (or editing the compiled
> binary) is cheating...)

Actually it is in rc0.d, look at the halt script.  It calls halt -p -d -f, at
least it does on my system, SuSE 6.4.  From the manpage for halt:
       -p     When halting the system, do a poweroff. This is the
              default when halt is called as poweroff.

> > But note that shutdown/reboot/halt are hardcoded to runlevels 0,1,6,
> > you ought to be able to recompile the source to change that...
> 
> I suspected as much.

Actually they're not in the binary.  It's all in inittab and what scripts it
calls.  If you want to halt at runlevel 3 make /etc/rc3.d have a symlink to
the halt script, just like it is in rc0.d.


-- 
Jon Schewe | http://eggplant.mtu.net/~jpschewe
For I am convinced that neither death nor life, neither angels 
nor demons, neither the present nor the future, nor any 
powers, neither height nor depth, nor anything else in all 
creation, will be able to separate us from the love of God that 
is in Christ Jesus our Lord. - Romans 8:38-39


---------------------------------------------------------------------
To unsubscribe, e-mail: tclug-list-unsubscribe at mn-linux.org
For additional commands, e-mail: tclug-list-help at mn-linux.org