[Nut-upsuser] nut suddenly stopped working...
selinger at mathstat.dal.ca
Tue Mar 6 03:59:19 CET 2007
> 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
> 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
> # 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."
> I tried inserting it:
> # See if we need to cut the power.
> if [ "$INIT_HALT" = "POWEROFF" ] && [ -x /etc/init.d/ups-monitor ]
> /etc/init.d/ups-monitor poweroff
> 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.
More information about the Nut-upsuser