I wanted a way to make the power button on my ATX machine
start a structured shutdown. I found a few patches for
linux 2.4 but not for 2.2.
After a few tests I found that there was not much work to do
so here is the patch.
Apply with
# cd /usr/src/linux
# patch -p1 < poweroff.diff
This will reject the suspend request and send a signal to init
the same as if you pressed .
To make the machine power off, change init so that
starts shutdown -h not shutdown -r.
This still requires your BIOS to be set so that the power switch
suspends the machine and not immediate power off. In my BIOS this
is called "after 3 seconds"