Re: Let init know user wants to shutdown

From: John Fremlin (chief@bandits.org)
Date: Wed Apr 11 2001 - 10:10:24 EST


 Pavel Machek <pavel@suse.cz> writes:

> Hi!
>
> > This is not correct, because we want the power button to be
> > configurable. The user should be able to redefine the power
> > button's action, perhaps to only sleep the system. We currently
> > surface button events to acpid, which then can do the right thing,
> > including a shutdown -h now (which I assume notifies init).
>
> There's no problem with configurability -- you can configure init as
> well. I saw it pretty much analogic to situation with Ctrl-Alt-Del:
> it also sends signal to init. Init then decides what to do. [I
> believe requiring acpid for such easy stuff is not neccessary...]

Using a signal to hit init with is a bit dubious because most signals
are hooked up for something else already. For example, SIGTERM sent to
my init (http://john.snoop.dk/programs/linux/jinit) would shutdown and
start sulogin, which is probably not what you want when you press the
off button. The FreeBSD init is similar FWIW (goes to single user
mode).

Some PM interfaces (e.g. APM) require a descision to be made by
software on such an event (to turn off or to "reject"). IMHO the best
way to do this is to exec a small script from kernelspace to get the
user's preferred policy; this is lighter weight than a daemon, doesn't
require some nasty magic number interface, and can be easily
programmed by any admin knowing sh or perl or whatever.

[...]

-- 

http://www.penguinpowered.com/~vii - 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/



This archive was generated by hypermail 2b29 : Sun Apr 15 2001 - 21:00:16 EST