I was set an interesting challenge
Standard Monitoring of UPS, power out extended so shutdown
but they want to .... have the server come back up automatically when the power comes back on
Setting BIOS to last powerstate is a pre-requisite, but..
How can I do this: if you change things you are going to get caught one way or another, use system halt instead of powerdown, what if the power doesn't go off - you are caught anyway
I'm thinking the procedure is
- Set the Grub timeout to 300 seconds
- Change the SHUTDOWNCMD to reboot
Then the machine will get low power at 5 minutes out and go into reboot waiting 5 minutes at grub screen, if the power goes off, last power state will kick in, otherwise it will startup from the reboot .. oh well all restarts will take 5 minutes - if they really want that
There isn't a reboot delay option, shutdown -t waits before the kill signal is sent, need a delay after the kill before the reboot