Jump to: navigation, search
/* Configure power button event handling */
* Ignore power button events handling by systemd, then reboot:
$ sed -i s/".*HandlePowerKey.*"/"HandlePowerKey=ignore"/ /etc/systemd/logind.conf$ reboot
* Install ACPI related software if not installed yet:
$ apt install acpi-support-base acpid
$ service acpid status
● acpid.service - ACPI event daemon
Loaded: loaded (/lib/systemd/system/acpid.service; disabled; vendor preset: enabled)
Active: active (running) since Wed 2018-10-17 03:53:36 EDT; 29s ago
Main PID: 919 (acpid)
Tasks: 1 (limit: 4389)
Memory: 280.0K
CGroup: /system.slice/acpid.service
└─919 /usr/sbin/acpid
Oct 17 03:53:36 x86-atp-master systemd[1]: Started ACPI event daemon.
Oct 17 03:53:36 x86-atp-master acpid[919]: starting up with netlink and the input layer
Oct 17 03:53:36 x86-atp-master acpid[919]: 1 rule loaded
Oct 17 03:53:36 x86-atp-master acpid[919]: waiting for events: event logging is off
button/power LNXPWRBN:00 00000080 00000008
NOTE#1: current power button handler is /etc/acpi/, but it does not work for some reason
NOTE #2: there are 2 events PBTN and LNXPWRBN, we need to handle only one of them, for example PBTN
* Create custom power button event rule:
$ cat > /etc/acpi/events/powerbtn-custom-rule << EOF
event=power (PBTN) 00000080