how to tell if system is rebooting from a crash/power failure?
I'm trying to come up with a startup init script that will check to see if the system was shut down gracefully, or if it is rebooting from a poweroff or something similar?
Anyone know of a way to check for this condition with the least amount of room for false positives or vice versa?
My intial thought is just a startup script that will will check for a file on startup, and on a proper reboot/shutdown just touch the file. But id like to avoid that type of script if possible, Im sure there is some other way to test for this correctly.
Btw... this is a sles10sp2 system.
|