Re: APM poweroff fix for 2.1.x

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


On Mon, 20 Apr 1998, Norbert Kiesel wrote:

> After upgrading to linux-2.1.97 I noticed that the poweroff feature of
> Linux no longer worked (i.e.. a "poweroff" or "halt -p" only shuts the
> system down). This used to work with Linux-2.0.x so I first thought it
> would be a kernel bug.

Are you sure it's a bug at all? I had the same problem, until
I realized the following:

· It is not shutdown(8)'s task to power down the system. That
is done by halt(8).

· halt(8) (and reboot(8)), when run at runlevel 1-5 (i.e. not
0 or 6), just invoke shutdown, with flag -h or -r.

· Running halt -p at runlevel 0 does indeed shut down the
system.

You are not supposed to run halt or reboot directly to shut
down the system, but use shutdown instead. If you do make the
mistake of running halt or reboot directly, they forgive you,
and kindly do what you were supposed to do: run shutdown
instead. Shutdown takes the system to runlevel 0 or 6, and
runs the appropriate script. That script typically contains a
halt or reboot as its last command. Add -p to the halt
command, and bingo! Your system powers down. (Of course, it
only does this if it is capable of soft power down, and you
have compiled in support for it.)

This works for me with stock sysvinit 2.74 and kernel 2.1.92.
To my knowledge, there have been no change in this behaviour
between 2.1.92 and 2.1.97.

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