Ciprian Marius Vizitiu
2007-Jun-24 20:59 UTC
[Nut-upsuser] Maybe this will make it to the FAQ :-)
Hi Arjen, I've just read the FAQ and got to the question: "Q: How can I make upsmon shut down my system after some fixed interval?" Well it looked like the question was there for me. :-) You say: Ask yourself this: why buy a nice big UPS with the matching battery and corresponding runtime and then shutdown early? If anything, I'd rather have a few more minutes running on battery during which the power might return. Once the power's back, it's business as usual with no visible interruption in service. If you purposely shut down early, you guarantee an interruption in service by bringing down the box. Although this sounds like a well considered argument it doesn't account for all situations. It's not uncommon in certain parts of the world to have power outages one after another with a say... 2 minutes in between. The power company does its best to restore power but the consumption is still too heavy so they need "a bigger hammer" :-)... I've seen it happening. In a situation like this things can get hairy. Let's assume the UPS has juice for 25 minutes; let's assume it takes 40s to shut down and 1min 20s to boot. In a scenario with the following events: "40 minutes power outage, power restore for 2 minutes, power outage for 10 minutes, power restore" you might end up having to manually say "Y" to fsck because the UPS has wasted all juice on the first outage and there was no time to recharge the batteries for the second outage... Chances are the machine is busy running scripts before nut gets a chance to start and anyway the second power failure strikes with no juice in the batteries. The other option is to shut down at 10 minutes after the first event so you have some 15 minutes left in the UPS; even if the second event comes right when the machine is booting there is enough juice for the machine to complete a boot->UPS-Alert->shutdown cycle, don't you think?
On 6/24/07, Ciprian Marius Vizitiu <cvizitiu at gbif.org> wrote:> Chances are the machine is busy running scripts > before nut gets a chance to start and anyway the second power failure > strikes with no juice in the batteries.Some UPSes provide a charge threshold so that the output of the UPS does not turn on until after the batteries have charged to beyond, say, 30%. If that threshold is adjustable (as I believe it is on several MGE models), you can be reasonably sure that the UPS will have enough runtime to allow the machine to boot to the point where NUT can detect a future power failure. Your scenario is definitely something to consider if the hardware does not provide this option, however. -- - Charles Lepple
Ciprian Marius Vizitiu wrote:> I've just read the FAQ and got to the question: "Q: How can I make upsmon > shut down my system after some fixed interval?" Well it looked like the > question was there for me. :-) > > You say: > > Ask yourself this: why buy a nice big UPS with the matching battery and > corresponding runtime and then shutdown early? If anything, I'd rather have > a few more minutes running on battery during which the power might return. > Once the power's back, it's business as usual with no visible interruption > in service. > > If you purposely shut down early, you guarantee an interruption in service > by bringing down the box.I didn't say this, I was referring to the FAQ and the part that was right before your quote:> If your system has a really complicated shutdown procedure, you > might need to shut down before the UPS raises the low battery flag. > For most users, however, the default behavior is adequate.In my (private) reply, I wrote that you need to setup 'upssched', a remark you also conveniently left out. You never mentioned anything about repeating power failures.> Although this sounds like a well considered argument it doesn't account for > all situations. It's not uncommon in certain parts of the world to have > power outages one after another with a say... 2 minutes in between. The > power company does its best to restore power but the consumption is still > too heavy so they need "a bigger hammer" :-)... I've seen it happening. In a > situation like this things can get hairy. Let's assume the UPS has juice for > 25 minutes; let's assume it takes 40s to shut down and 1min 20s to boot. In > a scenario with the following events: "40 minutes power outage, power > restore for 2 minutes, power outage for 10 minutes, power restore" you might > end up having to manually say "Y" to fsck because the UPS has wasted all > juice on the first outage and there was no time to recharge the batteries > for the second outage... Chances are the machine is busy running scripts > before nut gets a chance to start and anyway the second power failure > strikes with no juice in the batteries. The other option is to shut down at > 10 minutes after the first event so you have some 15 minutes left in the > UPS; even if the second event comes right when the machine is booting there > is enough juice for the machine to complete a boot->UPS-Alert->shutdown > cycle, don't you think?Read 'docs/shutdown.txt', especially the last part, 'One more tip'. Best regards, Arjen