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

A.Lizard alizard at ecis.com
Mon Mar 5 23:46:16 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.

I then tried changing the ups-monitor script:
original version:
     flag=`sed -ne 's#^ *POWERDOWNFLAG *\(.*\)$#\1#p' /etc/nut/upsmon.conf`
     wait_delay=`sed -ne 's#^ *POWEROFF_WAIT= *\(.*\)$#\1#p' /etc/default/nut`
     if [ -f "$flag" ] ; then
       if /sbin/upsmon -K >/dev/null 2>&1 ; then
         echo "Shutting down the UPS ..."
         sleep 1
         # if /sbin/upsdrvctl shutdown ; then

I tried changing:
if /sbin/upsdrvctl -u root shutdown ; then

That failed. I then tried changing the above line to:
if /lib/nut/newhidups -a belkin-ups -k ; then

What I got was hundreds of iterations of "did not claim interface 0 before use"

if /lib/nut/newhidups -a belkin-ups -k ; then

Note: /sbin/upsdrvctl -u root [command] belkin-ups
works for:
but NOT shutdown

I decided that if things are to the point where I'm trying to modify 
ups-monitor, it's time for me to ask for help.

member The Internet Society (ISOC), The HTML Writers Guild.
"You can't have in a democracy various groups with arms - you have to have 
the state with a monopoly on power." Condoleeza Rice, US Secretary of State
Personal Website http://www.ecis.com/~alizard
business Website http://www.reptilelabs.com
backup address (if ALL else fails) alizard at gmail.com
PGP 8.0 key available by request or keyserver. Download PGP from:
http://www.pgpi.org for e-mail privacy.
Disaster prep info: http://www.ecis.com/~alizard/y2k.html
***Looking for INTELLIGENT new technology public policy 
alternatives?***               http://www.ecis.com/~alizard/technology.html

More information about the Nut-upsuser mailing list