[plug] How to force a shutdown with reboot??

James Devenish devenish at guild.uwa.edu.au
Tue Dec 30 13:19:59 WST 2003


In message <20031230050303.GB6365 at erdos.home>
on Tue, Dec 30, 2003 at 01:03:03PM +0800, Cameron Patrick wrote:
> On Tue, Dec 30, 2003 at 12:55:30PM +0800, James Devenish wrote:
> | BTW I am under the impression that this would just invoke `shutdown`,
> | because traditionally you would want `shutdown` to do nice things and
> | poke `init` prior to `reboot` on a multi-user system.
> 
> No, it's actually equivalent to 'init 6' (or 'init 0' in the case of
> halt/poweroff).  reboot -f forces a reboot Right Now.  man reboot :-)

Bzzzt :) I looked at the source code for Debian 3 and had a look at the
man page on SuSE 8 and they looked like the same thing. It's like this:

    execv("/sbin/shutdown", args);

I'm not sure whereabouts your man page comes from, but the ones I've
seen from the sysvinit package contain phrases like this (taken from
SuSE 8):

    If halt or reboot is called when the system is not in runlevel 0
    or 6, shutdown(8) will be invoked instead (with the flag -h or -r).

    Under  older sysvinit releases , reboot and halt should never be
    called directly. From release 2.74 on halt and reboot invoke
    shutdown(8) if the system is not in runlevel 0 or 6.





More information about the plug mailing list