[Nut-upsuser] nut suddenly stopped working...

Peter Selinger selinger at mathstat.dal.ca
Tue Mar 6 03:59:19 CET 2007


A.Lizard wrote:
> 
> As I said earlier, I got it working using the -u root option.
> 
> I'm running on the Debian distribution.
> 
> Upon upsmon -c fsd , it shuts down the workstation, but NOT the UPS. In 
> order to shut down both, I first tried Peter Selinger's shutdown patch for
> init.d halt         :
> 
> note: program locations reflect where nut*.deb puts things in the Debian 
> filesystem.
> 
> if [ -f /etc/killpower ] ; then
>      # if USB is already disabled, re-enable it.
>      if [ ! -f /proc/bus/usb/devices ]; then
>          echo "Mounting USB filesystem"
>          mount -t usbfs usbfs /proc/bus/usb
>      fi
> 
>      # hotplugging is probably off, so run driver as -u root
>      echo "Killing the power, bye!"
>      /lib/nut/newhidups -u root -k belkin-ups
>      sleep 20
> 
>      # uh oh... the UPS power-off failed
>      # you probably want to reboot here so you don't get stuck!
>      # *** see the section on power races in shutdown.txt! ***
>      echo "Rebooting."
>      reboot
> fi
> 
> I tried inserting it:
>    # See if we need to cut the power.
>          if [ "$INIT_HALT" = "POWEROFF" ] && [ -x /etc/init.d/ups-monitor ]
>          then
>                  /etc/init.d/ups-monitor poweroff
> fi
> 
> before and after /etc/init.d/ups-monitor poweroff.

My scriptlet is not indended to be inserted *inside* anything. I have
no idea what the variable $INIT_HALT will be at shutdown time, but
most likely it is not set. Very likely the body of that "if" never
gets called at all.

-- Peter



More information about the Nut-upsuser mailing list