Is there some event I can hook into / listen for, like an Upstart event for ACPI poweroff, to broadcast a wall when the system is going down for restore?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Callbacks can be done a number of ways, but it is very trivial to add a script to fire on a specific runlevel. For instance, in Ubuntu, you have the following http://en.wikipedia.org/wiki/Runlevel#Ubuntu
A simple solution, would be to install / configure “postfix” and have a bash script run the ‘mail’ command found in the mail-utils package. If you’re going to power off the machine, you can place the script in /etc/rc0.d/ This of course, is run-level 0 or “halt”. If you do an ‘ls -lt’ in that directory, you’ll notice that there are symlinks:
What I would do, is find a logical place to store your callback script and symlink it here.
-Johnny Starr www.thestarrlab.com