Re: Let init know user wants to shutdown

Andreas Ferber
2001-04-16T16:00:42Z

Hi,

On Mon, Apr 16, 2001 at 02:42:03PM +0200, Simon Richter wrote:
>
> A power failure is a different thing from a power button press. There are
> users (me for example) who want to have something different then "init 0"
> mapped to the power button, for example a sleep state (since my box
> doesn't have a dedicated sleep button). I doubt there are many people who
> want something else than a shutdown if the power is out (although I think
> there will be with suspend-to-disk working, so we might have to change UPS
> handling here).

And why not do exactly this with init? Have a look in /etc/inittab:

% grep power /etc/inittab
# What to do when the power fails/returns.
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop

You can shut down your machine there, but you can also have it play a
cancan on power failure. It is up to your gusto. And now tell me, why
not choose a similar approach, but instead reinvent the wheel and
create a completely new mechanism?

Andreas
--
Besides, I think Slackware sounds better than 'Microsoft,' don't you?
-- Patrick Volkerding