Kyle Brandt asked:
When issuing a reboot or shutdown I see:
[kbrandt@ny-kbrandt01: ~] sudo reboot [sudo] password for kbrandt: Broadcast message from email@example.com (/dev/pts/3) at 14:50 ... The system is going down for reboot NOW!
I can see that this particular string is part of the binary:
[kbrandt@ny-kbrandt01: ~] strings /sbin/shutdown | grep NOW The system is going down for power off NOW! The system is going down for halt NOW! The system is going down for maintenance NOW! The system is going down for reboot NOW!
But does anyone know if there is a way I could add a reminder message to silence the host in our monitoring system without modifying the binary?
A very careful reading of the
shutdown(8) man page (i.e. not the first couple of times I looked and didn’t find anything) reveals that a custom message can be provided on the command line.
# shutdown -r +15 "We're rebooting for unicorns. Silence monitoring please." Shutdown scheduled for Tue 2014-11-25 10:17:53 EST, use 'shutdown -c' to cancel. # Broadcast message from root@saurok (Tue 2014-11-25 10:02:53 EST): We're rebooting for unicorns. Silence monitoring please. The system is going down for reboot at Tue 2014-11-25 10:17:53 EST!
On that note, if you have EL7 in the environment, I recommend you schedule your shutdowns for 1 minute ahead, if you want this message to be seen, rather than shutting down “now”, as in my experience users may be logged out before receiving the wall (due to systemd being so bloody fast to shutdown and start up the system).
On that note, if you want even faster reboots, set up kexec before you reboot, to skip the boring 1 to 15 minutes of the server self-testing its hardware…
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.