I may be mistaken about this, and doing it totally wrong, but I thought SIGPWR was actually sent to PID #1 by powerd, a daemon that monitors the serial port CTS line (* goes active on power failure *).
Right now I wrote and installed my own powerd that does exactly this. When CTS goes active, I do in C code...
Then if CTS goes inactive (before shutdown kills my daemon) I do this in C code...
Code:
system("/sbin/shutdown -c \"Power restored.\"");
My system() function call here bypasses the action defined in the /etc/inittab for power-restore.
Is my powerd doing this incorrectly then ?