Automatically Re-Boot FreeNAS after Power Failure

Status
Not open for further replies.

Jim

Dabbler
Joined
Jul 2, 2013
Messages
13
I have an APC UPS configured to shut down my FreeNAS box (via USB) after 10 minutes on battery power.

My question is: Is there ANY way to have the machine power on automatically when AC power is restored to the UPS?

My UPS model is an APC Back-UPS RS.

Thanks in advance!
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
That depends on your MB. Many will have a setting in the BIOS to power on when power is restored. This is typically turned off by default.
 

alexg

Contributor
Joined
Nov 29, 2013
Messages
197
I had similar question when I was building my NAS and I'm following advise provided by cyberjock. You don't want machine to power on automatically.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
It depends on your UPS and your settings. I prefer to leave my NAS off and manually restart it. The concern with having your NAS automatically come back on is if you have many blackouts close together where you end up draining your UPS and it cannot provide enough power to operate your NAS long enough in between blackouts. I noticed the OP said he shuts down his NAS after 10 minutes of being on the UPS. If he also shuts down the UPS in the process then it might work, but it depends on how the UPS works. It can get very involved but all I was doing was answering the question.
 

Jim

Dabbler
Joined
Jul 2, 2013
Messages
13
Joeschmuck, the problem with MB settings is that those are based on the computer's power supply turning back on when it senses 120V input. I have the UPS set to shut the machine down after 10 minutes, but in reality it could probably keep it running for more like 45 minutes (it's only a 1500VA UPS). So using the motherboard setting, it would probably re-start immediately since the UPS would still be outputting 12oV to the PC, then it would run for another 10 minutes until the timer ran out again, and so on until the battery died. Maybe this isn't the case, correct me if I'm wrong. Also, I didn't see any settings on the MB menus anyway (ASRock, Z77 chipset), which is weird because my circa 2005 machine from college even had that setting.

I didn't know if there was another way to do it. The reason I'd like to to re-start automatically on power-up is that it's hosting the website (Apache plugin) for my side business. (I know the next suggestion will be "you should get a hosted solution for your website" but it's not urgent enough to spend the money. I had the server/UPS before I started using it for hosting a website, hence not trying to figure out auto-reboot previously.)
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
You need to devise a way to turn your computer back on. The BIOS setting to turn the computer back on when power is applied will work when power is returned to the PC and will not be a looping cycle as you depicted above. So lets forget that and do something that is realistic and proper. What you could do instead is create a small circuit which you would connect up to a 115V outlet on your UPS which is not battery protected. This circuit would power on and after a specified amount of time (I'd say 10 minutes) then it would close a relay for 1 second. The Normally Open contact and Common contact would be connected to your FreeNAS PC power switch wires. The timer would only turn on the PC once the power has been on for 10 minutes and that should be good enough to ensure no more power outages. Of course you could opt for 30 minutes or whatever you please. A timer circuit could be made from a 555 timer chip, just look it up on the internet. If you don't have the skills to do this, find a friend that can.
 

Jim

Dabbler
Joined
Jul 2, 2013
Messages
13
Thanks joe, I vaguely remember 555 timers from my introduction to logic control class back in college, haha. I'll look into it.

I guess I was hoping there was a way to do boot-on-USB via a signal from the UPS that gets sent when 120V power service is restored, or something like that.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Boot on USB, not that I know of but I wouldn't be surprised if something like that existed, probably cost a pretty penny. Now the 555 timer thing was an off the cuff idea but I seriously believe it's a solid idea. You might even be able to find a product that could be adapted to something like that. Maybe use a digital timer/stopwatch that can be reset to a specific amount of time. So let's say you can locate a countdown timer that has a Reset button on it and of course an alarm output. You could take a 115VAC SPST relay and use it to trigger the Reset button of the countdown timer. When the countdown timer hits zero the alarm would sound. That alarm could be used to trigger another SPST relay (coil voltage dependent on the timer) and it would turn on the computer. I think I like the 555 timer more but you need to figure out the components for the proper time delay and it's not adjustable unless you use adjustable components. The per-built timer gives you a fully adjustable time delay, assuming you can get it to work. I'm certain coming up with a circuit is easy enough as well for the 555 timer. Parts could be purchased from Radio Shack, Digikey, or Mouser Electronics, or any other place you desire.

Update: So looks like you would need either two 555 timers or the 556 dual timer chip to make this work. The first timer will be the 10 minute delay and it will trigger the second timer which will generate a 1 to 2 second output that will be fed to either a transistor, SSR, or possibly just directly to the MB PWR connectors if the system is powered properly from the MB.
 
Status
Not open for further replies.
Top