This service allows you to handle chassis button presses on Synology DS216j NAS and similar Synology NAS models.
In this model, presses of the Power and Reset buttons are handled internally by the NAS hardware and are not directly accessible through Device Tree. However, when these buttons are pressed, the NAS hardware transmits special messages on the UART1 bus.
In the original Synology DSM OS, a special daemon, scemd, is responsible for
processing these messages. The source code for this daemon is not distributed
under the GPL, but its functionality can easily be replicated independently. You
just need to listen for and process the messages coming to the /dev/ttyS1.
Visit the Linux Device Hacking forum for detailed instructions and help on installing Debian on your device.
Run these commands to install the service:
cp ./etc/systemd/system/diskstation-keyd.service /etc/systemd/system/
cp ./usr/local/bin/diskstation-keyd.sh /usr/local/bin/
systemctl enable diskstation-keyd.service
systemctl start diskstation-keyd.service