[Nut-upsuser] UPS restart delay

Daniel O'Connor 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?

Yes.

>> 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'.

OK.

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..
        ${nut_prefix}/libexec/nut/upsdrvctl stop

        if [ -r /etc/killpower ]; then
                logger "Powering off"
                rm -f /etc/killpower
                export GSHOME=/home/radar/skiymet
                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
                    sendpowermail=0
                fi

                # No techmail address
                if [ -z "$techmail" ]; then
                    sendpowermail=0
                fi
                i=10
                while [ $i > 0 ]; do
                        ${nut_prefix}/libexec/nut/upsdrvctl shutdown
                        if [ $? -eq 0 ]; then
                                logger "upsdrvctl shutdown returned success"
                                break
                        fi
                        logger "upsdrvctl shutdown returned error"
                        i=$(($i - 1))
                        sleep 5
                done
                if [ $i -eq 0 ]; then
                        logger "upsdrvctl failed to shut the UPS down"
                fi

                if [ $sendpowermail -ne 0 ]; then
                    /usr/sbin/sendmail -t -fradar -ODeliveryMode=d <<EOF
To: $techmail
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.
EOF
                    sendmail -q
                fi
        fi
}

> 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)?

Yes.
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

Yes.

> @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...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4358 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20120806/f8c61df0/attachment.bin>


More information about the Nut-upsuser mailing list