Re: APM poweroff fix for 2.1.x

=?ISO-8859-1?Q?Johan_Myr=E9en?= (jem@vistacom.fi)
Tue, 21 Apr 1998 13:51:47 +0300 (EET DST)


On Tue, 21 Apr 1998, Kiesel, Norbert wrote:

> 2) SysVinit-2.74 states that it is correct to call "halt" from runlevel
> 3 (and that is would just call shutdown for you). It also states that
> "halt -p" or "poweroff" are intended for "halt and poweroff". But this
> does not work with plain SysVinit-2.74 ans Linux-2.1.x.

> Summary: My patch changes nothing with 2.0.x (hopefully :-) and allows
> "halt" and "poweroff" to behave as documented (from all runlevels) for
^^^^^^^^^^^^^
> 2.1.x.

What documentation are you referring to?

Halt is documented to simply invoke shutdown, if run from
runlevels 1-5. But it is not shutdown's task to shut down the
machine. Halt is supposed to do that, but not until runlevel
0.

You are not supposed to run halt, reboot or poweroff directly.
Yes, it is "correct", if you use a newer version of sysvinit.
"Correctness" means halt and reboot notice what you are trying
to do, and remedies the situation by automatically calling
shutdown (with -h or -r).

See 'man halt' and 'man shutdown'.

I think it would be better if halt and reboot only printed a
warning that your should use shutdown instead.

> 3) One could simply add a "-p" to the final invocation of halt in
> rc.d/0.d/halt to force poweroff.

This is the correct way to power off.

> But this would bring us back to the
> 2.0.x situation where a simple "halt" would also poweroff the machine
> (which is e.g. bad when you want to read the shutdown messages for
> debugging "halt" :-)

Well, don't put the -p in the halt script, then. :-)

Johan Myreen
jem@iki.fi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu