bc-bd.org

Not a blog

Immediate Shutdown After Boot

Is your linux configured to shut down on power button press and immediately shuts down after the next boot?

Use acpi_listen to check if you are getting two events for each button press:

button/power PBTN 00000080 00000000
button/power LNXPWRBN:00 00000080 0000001c

Hack around it by passing the event information to your script /etc/acpi/events/powerbtn:

...
action=/etc/acpi/powerbtn.sh %e

And reacting only on one /etc/acpi/powerbtn.sh:

...
[ "$2" == "PBTN" ] || exit 0