I was wondering if it was possible to have a logging program document a random power failure. Clearly it won't have any time to log when the power fails, but is there a way to recognize a power failure occurred when it reboots after the failure? I know Red Hat (and Linux in general) has some pretty good logs (/var/log
) but I don't think it has any native logging program that could handle a power failure.
If there is no logging program I was also debating changing the boot scripts. The BIOS is set for it to always be powered on; so if a power failure occurs, it automatically reboots.
The only time the system will be off is if a power failure happens; it will never be manually shut down.
Therefore, I was thinking of adding something (simple as a mail
command) to the boot scripts because every boot after the very first boot marks a power failure. Unfortunately, I don't know which file or location or the actual syntax of such a command would be.