Messages in this thread |  | | Date | Mon, 16 Apr 2001 17:49:45 +0200 | | From | Andreas Ferber <> | | Subject | Re: Let init know user wants to shutdown |
| |
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
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |