Re: Let init know user wants to shutdown

John Fremlin (chief@bandits.org)
18 Apr 2001 20:51:12 +0100


Simon Richter <Simon.Richter@phobos.fachschaften.tu-muenchen.de> writes:

[...]

> Yes, that will be a separate daemon that will also get the
> events. But I think it's a good idea to have a simple interface that
> allows the user to run arbitrary commands when ACPI events occur,
> even without acpid running (think of singleuser mode, embedded
> systems, ...).

The pmpolicy patch presents such a simple interface. An executable
(the location of which is configurable) is run from the kernel with
certain arguments.

The advantages of this:

(1) No nasty magic number binary interface, everything is text ->

(2) Any sysadmin can easily write an event handler in sh, perl, or
whatever scripting language, i.e. the userspace handler is much
simpler.

(3) No events, no bloat.

(4) Kernel code is probably shorter (tho' less standard) than having a
special device or procfs node.

(5) Efficiency: the alternative is to have a program like APMD
decoding the nasty binary interface and then spawning a shell script
to deal with it.

I myself am starting to dislike the idea: it was mostly motivated by
the need to exercise a veto on APM events. This is in fact not
necessary, if I understand correctly. An interface allowing multiple
listeners is preferable.

It remains to contact all the maintainers of the various PM and UPS
systems to flesh out exactly what the interface should be capable of
;-)

[...]

-- 

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/