Re: Let init know user wants to shutdown

Ben Ford
2001-04-16T22:42:50Z

Simon Richter wrote:

>On Fri, 13 Apr 2001, Pavel Machek wrote:
>
>>>Then a more general user space tool could be used that would do policy
>>>appropriate stuff, ending with init 0.
>>>
>>init _is_ the tool which is right for defining policy on such issues.
>>
>>Take a look how UPS managment is handled.
>>
>
>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).
>
>My plan for power management was to have a special daemon that would
>decide what to do based on system state (battery status, local time, ...)
>and events (power/sleep button, last user logged out, ...) [I know that
>from a programmer's POV, both are events]. This daemon could, for example,
>make sure that no services are affected, for example by priming WOL and
>entering a not-so-deep sleep state instead of doing a suspend-to-disk if
>someone is still listening on a port after the "shutdown unimportant
>services" scripts have been run.
>
> Simon
>
(root@qwerty)-(02:32pm Mon Apr 16)-(root)
# cat /etc/inittab | grep -1 CTRL

# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now

I believe that what is being referred to is similar. In which case, you
can put whatever the bleep you want here and do anything from popup a
message saying, "Shutdown denied" to immediately poweroff.

-b

--
Three things are certain:
Death, taxes, and lost data
Guess which has occurred.
- - - - - - - - - - - - - - - - - - - -
Patched Micro$oft servers are secure today . . . but tomorrow is another story!