Skip to contentSkip to conversation

Let init know user wants to shutdown

DISCUSSION David Balazic 2 participants 2 messages Apr 12, 2001 – Apr 16, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 9 lines · Pavel Machek

Hi!

Init should get to know that user pressed power button (so it can do shutdown and poweroff). Plus, it is nice to let user know that we can read such event. [I hunted bug for few hours, thinking that kernel does not get the event at all].

Here's patch to do that. Please apply,
Pavel

Isn't it better to just send the event to userspace , where is it caught by apmd ( or whatever has replaced it ). Then it can decide what to do about it, instead of dictating a shutdown from kernel ( policy alert ;-) )

Signature · 4 lines
David Balazic
--------------
"Be excellent to each other." - Bill & Ted
- - - - - - - - - - - - - - - - - - - - - -
#1 lore raw

Hi!

Quoted 5 lines
Quoted 5 lines

Init should get to know that user pressed power button (so it can do shutdown and poweroff). Plus, it is nice to let user know that we can read such event. [I hunted bug for few hours, thinking that kernel does not get the event at all].

Quoted 7 lines
Quoted 2 lines

Here's patch to do that. Please apply,
Pavel

Isn't it better to just send the event to userspace , where is it caught by apmd ( or whatever has replaced it ). Then it can decide what to do about it, instead of dictating a shutdown from kernel ( policy alert ;-) )

I'm not dictating policy: init is free to do anything it is configured to, including /sbin/apmd --button_came or echo "Don't you dare to plpress that button again".

Quoted 2 lines
Signature · 2 lines
The best software in life is free (not shareware)!		Pavel
GCM d? s-: !g p?:+ au- a--@ w+ v- C++@ UL+++ L++ N++ E++ W--- M- Y- R+