View previous topic :: View next topic |
Author |
Message |
MacGyver031 Tux's lil' helper
Joined: 11 Jul 2004 Posts: 141 Location: Ilavalai, Sri Lanka
|
Posted: Thu Nov 17, 2011 11:17 am Post subject: Configuring Nut for delayed shutdown |
|
|
Hi,
I have read some Nut configuration pages, but I do not see it through. I will specify my case:
We have a headless Gentoo server with Nut running. I would like to configure Nut so that if there is a power failure, system will be running 5min on battery and then shutdown otherwise. If the power is restored withing 5min, then the system does not shutdown at all.
So for what I have read: Some say that the shutdown is initiated when the battery is running low (to the dimension of my ups, this should be over 10min).
Others say that the shutdown is called immediately (which is not so good for me, because we have very short power loss, but bigger blackout is very rare).
So, am I correct that I should setup the upssched.conf and a external shutdown-execute-command-file, and remove the SHUTDOWNCMD in upsmon.conf?
Or is there any "easier" way to configure Nut?
Thanks. _________________ Sincerely your
Joanand K.
MacBook Pro 5.1: 2.4GHz Core2 Duo, 4096MB, 500GB, NVidia 9400/9600 M GT
Gentoo, Kernel 3.4.9, XOrg, Fluxbox. |
|
Back to top |
|
|
MacGyver031 Tux's lil' helper
Joined: 11 Jul 2004 Posts: 141 Location: Ilavalai, Sri Lanka
|
Posted: Thu Nov 17, 2011 11:49 am Post subject: |
|
|
Well, now I have read something which clears up a little:
Quote: | The whole point of UPS software is to bring down the OS cleanly when you run out of battery power. Everything else is roughly eye candy. |
And my upsc states:
Quote: | battery.runtime: 1440
battery.runtime.low: 120 |
So that means that my server will be running about 10-24min depending on the load and then it has about 2min to shutdown.
Soo, in my case, I should look for the "ONBATT" event and start the timer for 600s. As soon as 600s have passed, my script should call the "shutdown -h now".
If the power is restored, then I should CANCEL-TIMER. Can anyone confirm that it is so?
Thanks. _________________ Sincerely your
Joanand K.
MacBook Pro 5.1: 2.4GHz Core2 Duo, 4096MB, 500GB, NVidia 9400/9600 M GT
Gentoo, Kernel 3.4.9, XOrg, Fluxbox. |
|
Back to top |
|
|
jmartos Tux's lil' helper
Joined: 23 Mar 2008 Posts: 76
|
Posted: Sun Nov 20, 2011 2:03 pm Post subject: |
|
|
That is the way I have my UPS set up with NUT. One timer is started when on battery alert is signaled and the timer is cancelled when power is restored. I do have my on battery timer set to a much lower time than what the UPS can handle since I also want to take care of cases where power is repeatedly interrupted after an initial interruption. You don't want to drain your batteries on the first power interruption and not be able to support subsequent interruptions. This may not apply to you, but I wanted to avoid that condition since the batteries would take longer to recharge and the maximum time on UPS power would change. Hope that helps. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|