Hi Roger,<br><br>note that I'm cc'ing Stanislav (maintainer of the NUT packages in Suse).<br>thanks for Kris Jordan for the support interim too ;)<br><br><div class="gmail_quote">2012/10/28 Roger Price <span dir="ltr"><<a href="mailto:roger@rogerprice.org" target="_blank">roger@rogerprice.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, 26 Oct 2012, Kris Jordan wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Did you install NUT from a package? Note, 2.6.5 is the current<br>
version and 2.6.4 had fixed a vulnerability.<br>
</blockquote>
<br>
I'm using the nut 2.6.3 package included in the openSUSE 12.2 distribution.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Check that your distribution's shutdown script is running 'upsdrvctl shutdown' in the presence of the killpower file<br>
(POWERDOWNFLAG).<br>
</blockquote>
<br>
Summary: looks like an openSUSE bug, simple fix available.<br>
<br>
OpenSUSE 12.2 has a script /usr/sbin/rcupsd for starting and stopping the upsd service. This is a link to script /etc/init.d/upsd which contains:<br>
<br>
    powerdown)<br>
        ## Special command: Instruct UPS to shutdown.<br>
        sync &<br>
        if grep -q '^\[' $UPS_CONFIG ; then<br>
            echo -n "Instructing UPS to powerdown "<br>
            $UPSDRVCTL_BIN shutdown >/dev/null 2>&1 || rc_failed<br>
            rc_check<br>
        else<br>
            echo "No local UPS defined, skipping powerdown "<br>
        fi<br>
        rc_status -v<br>
        ;;<br>
    try-powerdown)<br>
        ## Special command: Instruct UPS to shutdown, if halt is running<br>
        ## or variable UPSD_POWERDOWN_CONDITION is set and power is failing.<br>
        ## Otherwise silently quit.<br>
        ##<br>
        if test "$RUNLEVEL" = "0" -o -n "$UPSD_POWERDOWN_CONDITION" ; then<br>
            if test -n "$POWERDOWNFLAG" -a -f "$POWERDOWNFLAG" ; then<br>
                exec $0 powerdown<br>
            fi<br>
        fi<br>
        ;;<br>
<br>
where  UPSDRVCTL_BIN=/usr/lib/ups/<u></u>driver/upsdrvctl<br>
<br>
In addition, file /etc/sysconfig/shutdown contains the configuration parameter<br>
<br>
  # Hook during system shutdown to run extra command<br>
  HALT_POWERDOWN_INSERT="/etc/<u></u>init.d/upsd try-powerdown"<br>
<br>
but when upsd try-powerdown is called it fails silently because $RUNLEVEL and $UPSD_POWERDOWN_CONDITION are empty.  upsd powerdown is never called.<br>
<br>
I changed the configuration parameter to HALT_POWERDOWN_INSERT="/etc/<u></u>init.d/upsd powerdown", reran command SuSEconfig, and tried again but there was no change.  However typing the command /etc/init.d/upsd powerdown does shut down the UPS unit.<br>

<br>
OpenSUSE 12.2 has fully embraced systemctl and systemd: I tried grepping around in the /lib/systemd shutdown specifications, but I cannot find any reference to /etc/init.d/upsd powerdown.  This is beginning to look like a bug in openSUSE 12.2 which I will report in their forums.<br>

<br>
Here is a fix: There is a file /etc/init.d/halt.local which is currently empty:<br>
<br>
 # /etc/init.d/halt.local<br>
 # script with local commands to be executed from init on system shutdown<br>
 # Here you should add things, that should happen directly before shuting<br>
 # down.<br>
<br>
I added the lines<br>
<br>
 # RP 2012-10-28 Turn off the UPS unit.<br>
 # Needed for automatic system restart when wall power returns.<br>
 UPSDRVCTL_BIN=/usr/lib/ups/<u></u>driver/upsdrvctl<br>
 echo `date -I` `date +%T` "$0 calls $UPSDRVCTL_BIN shutdown" >> /var/log/halt.local<br>
 $UPSDRVCTL_BIN shutdown<br>
<br>
I pulled the plug from the wall and witnessed a server shutdown followed 10 seconds later by a UPS shutdown.  Pushing the plug back into the wall got the system running again.<br></blockquote></div><br>I just saw that you (Roger) had a parallel discussion on Suse forums, possibly leading toward some systemd integration issue...<br>
<br>maybe Stan can shed some light on this.<br><br>cheers,<br>Arnaud<br clear="all">-- <br>Network UPS Tools (NUT) Project Leader - <a href="http://www.networkupstools.org" target="_blank">http://www.networkupstools.org</a><br>
Debian Developer - <a href="http://www.debian.org" target="_blank">http://www.debian.org</a><br>Free Software Developer - <a href="http://arnaud.quette.fr" target="_blank">http://arnaud.quette.fr</a><br><br>