Power Button Additional Commands

jgregoirejgregoire New Member Posts: 2

I'm using an external power button on CN2 to power down the device. I need the system to run the command systemctl stop yourservice when the power button is pressed. I've tried adding a custom ACPI script and function for this command. If I run this ACPI service I've created, it functions as expected and shuts the system down. However, pressing the power button doesn't do anything.

I'm pretty sure the /sbin/shutdown binary is taking precedence.

Can anyone provide any help as to what can be done in this situation? I would just like the power button to run a script or command on button press.

OS: Ubuntu 18.04
Kernel: 5.4.0



Sign In or Register to comment.