LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   reboot after power failure? (https://www.linuxquestions.org/questions/linux-general-1/reboot-after-power-failure-432508/)

ncsuapex 04-06-2006 07:54 PM

reboot after power failure?
 
Ok,


I did a search both here and google and couldnt find an answer that made sense...


How can I make my linux box reboot when the powerfails? I live in an area where the power often blinks out for a second, causing my computers to turn off.. I am looking for a way to have them automatically reboot when the power comes back on. They are not on UPS.


I found this in /etc/inittab but I'm not sure exactly what to change or if it would even work if I did change it.



# What to do when the power fails/returns.
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop


Thanks!

michaelk 04-06-2006 09:12 PM

AFAIK the powerfail etc commands are base on status signals from a UPS.
BTW Power sags and dropouts can be bad for computers and I suggest getting a UPS.
I do not know if this is possible with a regular PC.

Matir 04-06-2006 09:51 PM

On most computers, you can select their "power on" status. However, this has absolutely nothing to do with Linux and everything to do with your BIOS. Consult your BIOS documentation for details.

ncsuapex 04-07-2006 08:54 PM

ok, thanks for the responses.

haertig 04-07-2006 09:20 PM

Quote:

Originally Posted by ncsuapex
I live in an area where the power often blinks out for a second, causing my computers to turn off.

I would suggest that if this describes your power situation, the last thing you want to do is have them automatically reboot. Yanking the power out from under a running Linux is not the best thing in the world (not for any OS), but having the OS automatically bounce up and down like a crazed basketball during your frequent power outages is not the best way to deal with the situation. I can imagine your poor computer crashing, automatically coming back up, start cleaning up the carnage with an fsck, and then crashing again in the middle of that operation due to another power failure. Gives me the willeys just thinking about it.

If you need your computers to be available, buy a UPS. They really don't cost that much. You can get by with one of lower reserve capabilities by not plugging your monitor into a battery outlet (plug it into one of the UPS's surge-only outlets.) If you really want to ping-pong the poor thing, BIOS is where you can set this up, as others have said.


All times are GMT -5. The time now is 11:05 PM.