[Nut-upsuser] UPS restart delay
doconnor at gsoft.com.au
Mon Aug 6 08:45:15 UTC 2012
On 06/08/2012, at 18:04, Arnaud Quette <aquette.dev at gmail.com> wrote:
> first, just to be sure: are you using newmge-shut from NUT 2.6.4?
>> The power was removed and the shutdown script calls 'upsdrvctl stop' and then 'upsdrvctl shutdown' - is that the right thing to do?
> the very right thing to do is to first fully stop NUT (including driver(s), upsd and upsmon).
> then call 'upsdrvctl shutdown'.
I re-read the rc.d script and I believe this is the case.
>> It seems the UPS does not turn itself off properly.
> depending on the exact timing of your sequence, you may be running into a race condition, where the previous shut driver is not yet stop, and the new ('shutdown') instance is already started.
Does 'upsdrvtl stop' block? The rc.d script does..
if [ -r /etc/killpower ]; then
logger "Powering off"
rm -f /etc/killpower
sendpowermail=`$GSHOME/bin/read_conf.tcl -1 sendpowermail 2>/dev/null`
sitename=`$GSHOME/bin/read_conf.tcl -1 sitename 2>/dev/null`
techmail=`$GSHOME/bin/read_conf.tcl -1 tech_mail 2>/dev/null`
if [ -z "$sendpowermail" ]; then
# No techmail address
if [ -z "$techmail" ]; then
while [ $i > 0 ]; do
if [ $? -eq 0 ]; then
logger "upsdrvctl shutdown returned success"
logger "upsdrvctl shutdown returned error"
i=$(($i - 1))
if [ $i -eq 0 ]; then
logger "upsdrvctl failed to shut the UPS down"
if [ $sendpowermail -ne 0 ]; then
/usr/sbin/sendmail -t -fradar -ODeliveryMode=d <<EOF
Subject: Warning: UPS battery critical at $sitename
Power failed and UPS battery is critical at site $sitename (`/bin/hostname`).
The time is `date \"+%Y%m%d %T\"`
System shutting down immediately.
> also, it seems your battery.charge.low is set to 50. can you please confirm it, since it's not in ups.conf (so probably done through upsrw)?
I want to set it quite high to increase the life of the battery.
> so there are 2 things:
> 1) fix the shutoff sequence to have the UPS powered off when needed
> 2) solve the battery.charge.restart issue
> @Fred: could you please test the following with an EX 11 RT:
> 1) simple shutoff (Ie, just call "newmge-shut -k..." or "upsdrvctl shutdown") and check that the UPS is powered off,
> 2) check that "battery.charge.restart" variable is available on this unit, and behaving correctly (Ie, if set to 30, the UPS will restart only once battery.charge reaches 30 %).
Thanks very much!
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4358 bytes
Desc: not available
More information about the Nut-upsuser