[PLUG] shutdown -h vs. init 0

Karl M. Hegbloom karlheg at pdxlinux.org
Tue Sep 17 20:26:15 UTC 2002


On Tue, 2002-09-17 at 10:37, Matt Alexander wrote:
> Other than the warning message produced by using "shutdown -h", is there
> any advantage to using it over "init 0" on Linux?  I know on other *nix
> systems, the shutdown command also calls sync and gracefully shutdowns
> processes, but I thought I read somewhere that Linux does this
> automatically when changing to runlevel 0.

"telinit 0" will run the K and S scripts in /etc/rc0.d.  That's about
ALL it really does...

Actually, what it really does is look in the /etc/inittab for a line
like this:

  l0:0:wait:/etc/init.d/rc 0

... which says that when it is asked to enter runlevel 0, it should
execute "/etc/init.d/rc" with the argument "0".  That script could do
just about anything at all, so you'll have to RTFS to see what it in
fact does.  Perhaps the man page actually does accurately document it's
actions.  (That would be most awesome, wouldn't it?)





More information about the PLUG mailing list