Add customisable SIGINT behaviour to procd
Username: multiplexd
Origin: https://bugs.openwrt.org/index.php?do=details&task_id=751
I am running LEDE 17.01.1 on a Linksys NSLU2.
The device has a power button on the front panel, which will boot the device when pressed when power is present. If the button is pressed when the device is running the device will reboot. I would like to be able to configure the device to power off when the button is pressed instead.
I have tried editing some of the stock scripts in /etc/rc.button to no effect. I ran across
this page
on the OpenWrt wiki, which suggests that pressing the button causes SIGINT to be delivered to PID 1.
I took a look at the procd git repository, and procd reboots the system when it catches SIGINT. If this were configurable then procd could take specific action, such as powering the device down, when it receives a hardware interrupt.