Linux – Prevent poweroff on Debian when the physical power button is pressed

acpidebianlinux

I'm on Debian-Lenny.

I want to change the action taken by the system when the power button is pressed. How do I modify the system such that it does not power off when it gets an Power Button ACPI event?

(My server is in my room, and I don't want my girlfriend to power off my server by pressing the physical power button.)

How can I achieve that?

Best Answer

To change the actions that the server takes when it receives an ACPI event indicating the power button, edit the: /etc/acpi/powerbtn.sh script.

This will not prevent holding the button to force power off, however.

While we're at it, the line in /etc/inittab:

ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

Controls the action taken upon pressing C-A-D.

Related Question