UPS Shutdown

Status
Not open for further replies.

George51

Contributor
Joined
Feb 4, 2014
Messages
126
I have a FreeNS box attached to a APC Smart UPS. I've configured the UPS service, and it all works as expected.

I have
Code:
ignorelb
override.battery.runtime.low = 1200
override.battery.charge.low = 20

For the ups.conf

Which means (and functions correctly) that FreeNAS turns itself (and a pfSense box) off when either the charge is below 20% or it reports less than 20 mins runtime.

This all fine, and both the pfSense box and FreeNAS do indeed turn off when either of these conditions are met.

I have two questions: 1 - the time it takes FreeNAS to shutdown is outrageous. I tested this morning and it took just in excess of 15 mins. This is from the point when the UPS goes onto Low Battery, FreeNAS identifies and issues an automatic shutdown notice. Within a minute the pfSense box has completed its shutdown.

I lost access to jails within a minute or so, I had access to the WebGUI for probably around 5 mins, and then a further 10 minutes for the shutdown procedure to finish and then power off the UPS. Whilst I had no access to FreeNAS for those 10 minutes the hdd light was blinking, and all the systems fans were still spinning etc etc. Now it did shutdown (and just before it does the UPS says shutdown initiated by USB, counts down from 180 seconds and powers off after the shutdown has completed dropping the rest of the load) Therefore its functioned perfectly, but I am a little concerned with why it takes FreeNAS 15 mins to shutdown. when via the webGUI shutdown is a lot quicker?

Second question - if the power has been out long enough to discharge the batterys to the point where everything turns off - I don't want the UPS to boot until I have more charge (and therefore runtime) than the low battery condition. I.e wait until its at 30% charge before turning everything back on. I tried to use

override.battery.charge.restart = 30

But as soon as I gave the UPS power, everything turned on, the pfSense and FreeNAS both received power and started booting up. The UPS only had 6% charge at this point, and if there was to be another power cut, wouldn't be able to shutdown in time. Any advice on making this work?
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
That's probably because of the bug about the shutdown delay, I really need to take the time to fill a bug report about that...

In short the delay before the system shutdowns you put in the GUI UPS settings window is used twice instead of once only, so the system takes double the time before it even start to shutdown.

There's a fix (not udpate persistent though) but I'm not at home right know and I don't remember the file to modify so you'll to wait until after I'm back at home or for someone else to answer.
 
Last edited:

George51

Contributor
Joined
Feb 4, 2014
Messages
126
That's probably because of the bug about the shutdown delay, I really need to take the time to fill a bug report about that...

In short the delay before the system shutdowns you put in the GUI UPS settings window is used twice instead of once only so the system takes double the time before it even start to shutdown.

There's a fix (not udpate persistent though) but I'm not at home right know and I don't remember the file to modify so you'll to wait until after I'm back at home or for someone else to answer.
Thanks for the prompt reply - slightly confused about what shutdown delay. I look forward to a reply once you're home.

Cheers
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Ok, so open the GUI, go to Services --> UPS and tell me what value you have in the shutdown timer field please.
 

George51

Contributor
Joined
Feb 4, 2014
Messages
126
Ok, so open the GUI, go to Services --> UPS and tell me what value you have in the shutdown timer field please.
Ahh I see what you were going for.

I utilise shutting down when the UPS is on low battery (hence the 1200 seconds or 20%), therefore the UPS shutdown timer filed is greyed out. However - I used to use the shutdown timer so the value that is there is 900 seconds, surely this shouldn't be having an effect now?
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
surely this shouldn't be having an effect now?

Oh yes it will... :D Yep, it's a very nasty bug, even when the field is disabled the value is still used where it shouldn't...

So, the idea is to edit these two files: /conf/base/etc/ix.rc.d/ix-ups and /etc/ix.rc.d/ix-ups

Replace the line FINALDELAY ${ups_shutdowntimer} with FINALDELAY 10

Then stop and start the UPS service to apply the change (if you want to be 100 % sure you can also reboot the server if it doesn't bother you) ;)

NB: this modification can be overwritten by an update so after you apply an update you need to check that the modification is still here and remake it otherwise.
 

George51

Contributor
Joined
Feb 4, 2014
Messages
126
NB: this modification can be overwritten by an update so after you apply an update you need to check that the modification is still here and remake it otherwise.

Thank you - changes made. Now I've just to remember to do (or at least check) each time I update. Did you submit your bug report about it?

Now to see if I can solve the second question...
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Nop, didn't have the time... I just got back at home and it's 23:30 here for example... I'll dot it asap ;)
 

George51

Contributor
Joined
Feb 4, 2014
Messages
126
Oh yes it will... :D Yep, it's a very nasty bug, even when the field is disabled the value is still used where it shouldn't...

So, the idea is to edit these two files: /conf/base/etc/ix.rc.d/ix-ups and /etc/ix.rc.d/ix-ups

Replace the line FINALDELAY ${ups_shutdowntimer} with FINALDELAY 10

Then stop and start the UPS service to apply the change (if you want to be 100 % sure you can also reboot the server if it doesn't bother you) ;)

NB: this modification can be overwritten by an update so after you apply an update you need to check that the modification is still here and remake it otherwise.
Can confirm this modification is over written by upgrading to the latest 9.10 stable.

However - I had previously set the shutdown mode to "on battery" edited the shutdown timer to 15, then changed the shutdown mode back to "reaches low battery" so it now has the greyed out 15, rather than the previous 900.

So I now assume worst case, it counts it twice and I will end up with a 30 second delay? and therefore don't need to worry about editing those two files again as 30 seconds is acceptable?
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
So I now assume worst case, it counts it twice and I will end up with a 30 second delay? and therefore don't need to worry about editing those two files again as 30 seconds is acceptable?

Yes, in theory it works like that. You might want to do a test to be 100 % sure ;)
 
Status
Not open for further replies.
Top