# [Solved] NUT Stopped Working After Upgrade to 2.4.3-r2

## jagdpanther

Nut 2.4.1-r1 was working well with my Eaton (PowerWare) 5115.  I emerged 2.4.3-r2 today and now Nut's upsdrv won't start:

```
# /etc/init.d/upsdrv start

 * Caching service dependencies ...                                                           [ ok ]

 * Starting UPS drivers ...

Network UPS Tools - UPS driver controller 2.4.3

Network UPS Tools - BCMXCP UPS driver 0.23 (2.4.3)

USB communication subdriver 0.18

Can't claim POWERWARE USB interface: could not claim interface 0: Device or resource busy

Unable to find POWERWARE UPS device on USB bus (USB)

Things to try:

 - Connect UPS device to USB bus

 - Run this driver as another user (upsdrvctl -u or 'user=...' in ups.conf).

   See upsdrvctl(8) and ups.conf(5).

Fatal error: unusable configuration

Driver failed to start (exit status=1)

 * Failed to start UPS drivers!                                  
```

Any ideas on how to get NUT running again?

Here is the device from lsusb:

```
Bus 001 Device 004: ID 06da:0002 Phoenixtec Power Co., Ltd UPS
```

Here are the configuration files, without all the comments:

nut.conf:

```
MODE = none

```

ups.conf:

```
[PW5115]

        driver = bcmxcp_usb

        port = notUsed

        desc = "Power Ware (Eaton) 5115  on runner"

```

upsd.conf

```
LISTEN 127.0.0.1 3493

```

upsd.users

```
[monuser]

                password = xxxxxxxx

                upsmon master

```

upsmon.conf

```

MONITOR PW5115@localhost 1 monuser xxxxxxxx master

MINSUPPLIES 1

SHUTDOWNCMD "/sbin/shutdown -h +0"

NOTIFYCMD /usr/sbin/upssched

POLLFREQ 5

POLLFREQALERT 5

HOSTSYNC 15

DEADTIME 15

POWERDOWNFLAG /etc/killpower

NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC

NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC

NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC

RBWARNTIME 43200

NOCOMMWARNTIME 300

FINALDELAY 5

```

upssched.conf

```
CMDSCRIPT /etc/nut/upssched-cmd

AT ONBATT * START-TIMER   onbattwarn 10

AT ONLINE * CANCEL-TIMER  onbattwarn

AT LOWBATT * EXECUTE      lowbattwarn

AT ONBATT * START-TIMER   timeshutdown 100

AT ONLINE * CANCEL-TIMER  timeshutdown

```

I also tried reverting to 2.4.1-r1 and that did NOT fix the problem.   Help.Last edited by jagdpanther on Mon Jul 26, 2010 1:23 am; edited 1 time in total

----------

## kimmie

 *Quote:*   

> 
> 
> ```
> # /etc/init.d/upsdrv start
> 
> ...

 

Looks like some module has already claimed your USB device? What does lsusb -t show you? (there should be no driver for that USB port if upsdrv isn't running, otherwise the driver should be "usbfs").

----------

## idella4

kimmie

```

idella@gentoo64 ~ $ sudo emerge -pv sys-power/nut

Password:

 * Last emerge --sync was 76d 48m 8s ago.

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild  N    ] sys-power/nut-2.4.1-r2  USE="bash-completion hal ssl xml -cgi -snmp -usb" 1,095 kB

```

Have you inserted the required USE flags in make.conf?

Can you post

cat /etc/mtab.

Oh, and 

sudo tail /var/log/dmesg

Now,

 *Quote:*   

> 
> 
>  Run this driver as another user (upsdrvctl -u or 'user=...' in ups.conf). 
> 
>     See upsdrvctl(8 ) and ups.conf(5). 
> ...

 

 *Quote:*   

> 
> 
>  ups.conf:
> 
> Code:
> ...

 

is a clue.

 See upsdrvctl(8 ) and ups.conf(5) is another clue.  Time to hit the man pages.

----------

## kimmie

 *idella4 wrote:*   

> kimmie
> 
> 

 

Ummm... yes? BTW his nut config is fine, port is ignored for this driver.

----------

## idella4

oh dear, I got it wrong.

woops.

kimmie

should be 

jagdpanther,

 and

BTW his nut config is fine, port is ignored for this driver.

ok,   :Wink: 

----------

## jagdpanther

Still can't get NUT working with my Eaton (PowerWare) 5115.  (I am now using a new Gentoo box with the exact same configuration and getting the exact same error.)

Kimmie is probably right, something is claiming the device:

lsusb: 

```
 # lsusb

Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 003 Device 005: ID 06da:0002 Phoenixtec Power Co., Ltd UPS

Bus 003 Device 002: ID 067b:2305 Prolific Technology, Inc. PL2305 Parallel Port

Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 001 Device 003: ID 06cd:010a Keyspan USA-49W serial adapter

Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 005 Device 002: ID 046d:c045 Logitech, Inc. Optical Mouse

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
```

Ok the UPS is Bus 003 Device 005

Here is the requested lsusb -t

```
Bus#  8

`-Dev#   1 Vendor 0x1d6b Product 0x0002

Bus#  7

`-Dev#   1 Vendor 0x1d6b Product 0x0002

Bus#  6

`-Dev#   1 Vendor 0x1d6b Product 0x0001

Bus#  5

`-Dev#   1 Vendor 0x1d6b Product 0x0001

  `-Dev#   2 Vendor 0x046d Product 0xc045

Bus#  4

`-Dev#   1 Vendor 0x1d6b Product 0x0001

Bus#  3

`-Dev#   1 Vendor 0x1d6b Product 0x0001

  |-Dev#   2 Vendor 0x067b Product 0x2305

  `-Dev#   5 Vendor 0x06da Product 0x0002

Bus#  2

`-Dev#   1 Vendor 0x1d6b Product 0x0001

Bus#  1

`-Dev#   1 Vendor 0x1d6b Product 0x0001

  `-Dev#   3 Vendor 0x06cd Product 0x010a
```

The requested /etc/mtab:

```
/dev/sdb3 / reiserfs rw,noatime 0 0

proc /proc proc rw 0 0

sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0

udev /dev tmpfs rw,nosuid,relatime,size=10240k,mode=755 0 0

devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0

/dev/sdb1 /boot ext2 ro,noatime 0 0

/dev/sdb5 /var reiserfs rw,noatime,notail 0 0

/dev/sdb6 /tmp reiserfs rw,noatime,notail 0 0

/dev/sdb7 /sdb7 reiserfs rw,noatime 0 0

/dev/sda6 /sda6 reiserfs rw,noatime 0 0

none /dev/shm tmpfs rw,noatime 0 0

usbfs /proc/bus/usb usbfs rw,noexec,nosuid,devmode=0664,devgid=85 0 0
```

What could be grabbing the UPS USB device?

This shows the USE flags used when I emerged nut: 

```
[ebuild   R   ] sys-power/nut-2.4.3-r2  USE="bash-completion hal ssl usb xml -cgi -snmp" 0 kB
```

Everything was working until I upgraded from 2.4.1-r1  but reverting does not fix the issue.

I guess I could try using LanSafe V6 but I really prefer to use open-source software when I can.

----------

## jagdpanther

Here is the difference between running /etc/init.d/upsdrv start with and then without the UPS USB connection:

With the UPS USB cable connected:

```
# /etc/init.d/upsdrv start

 * Starting UPS drivers ...

Network UPS Tools - UPS driver controller 2.4.3

Network UPS Tools - BCMXCP UPS driver 0.23 (2.4.3)

USB communication subdriver 0.18

Can't claim POWERWARE USB interface: could not claim interface 0: Device or resource busy

Unable to find POWERWARE UPS device on USB bus (USB)

Things to try:

...
```

And here without the UPS USB  connection

```
 # /etc/init.d/upsdrv start

 * Starting UPS drivers ...

Network UPS Tools - UPS driver controller 2.4.3

Network UPS Tools - BCMXCP UPS driver 0.23 (2.4.3)

USB communication subdriver 0.18

Can't open POWERWARE USB device, retrying ...

Can't open POWERWARE USB device, retrying ...

Can't open POWERWARE USB device, retrying ...

Can't open POWERWARE USB device, retrying ...

```

So it does look like something is 'grabbing' the UPS USB device when it is connected.

----------

## jagdpanther

 *Quote:*   

> Looks like some module has already claimed your USB device? 

 

>From /proc/bus/usb/devices:

```
...

T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  5 Spd=1.5 MxCh= 0

D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1

P:  Vendor=06da ProdID=0002 Rev= 1.00

S:  Manufacturer=Powerware

S:  Product=Powerware UPS

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 60mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=usbfs

E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=20ms

...
```

Should the kernel usb module driver be usbfs?  If not how do I change this?

----------

## kimmie

If downgrading doesn't solve the problem, it must be some other upgrade... likely candidates are a new kernel or changed kernel config or new udev. I suspect your problem is related to permissions on the usb device node. The device node to be writable by the 'nut' user for nut to work.

First, lets take your /proc/bus/usb mount; this is deprecated in favour of udev and the device nodes under /dev/usb.  Perhaps nut is looking for a device node under /proc/bus/usb first and not under /dev/usb; in that case it's probably encountering a device node owned by hal (that's group 85, from your fstab line), and then barfing. I can't remember when I last had the /proc/bus/usb mount on any of my systems. I would comment out the fstab line and unmount /proc/bus/usb (or reboot if you can't do the unmount), restart upsdrv and unplug/replug your UPS, see if that fixes the problem.

If it doesn't then the problem is with udev. Check the device node for your device with ls -l /dev/bus/usb/003/005 (presuming it's plugged into the same port). If the device isn't 664 and owned by user root, group nut, then udev hasn't given it the right permissions. Have a look in  '/etc/udev/rules.d/70-nut-usbups.rules' and see if your device is listed; if not you'll be able to work out what to add given the other entries. If you make a change to the file, you can ask udev process it using 'udevadm trigger', if your change worked, the effect will show up in the /dev node, then you can restart upsdrv.

As to leaving the /proc/bus/usb mount permanently out of fstab, from what I read this shouldn't cause a problem. If some older or non-free software complains or you find other usb devices are now having issues, you can probably put it back and then change the permissions on the /proc/bus/usb/.... node for your UPS to suit nut somehow.

Let us know how you go!

----------

## jagdpanther

Thanks for all of the replies.

The only reference to /proc/anything I have in /etc/fstab is:

none        /proc             proc        defaults          0 0 

I probably have some kernel setting that gives me /proc/bus/usb ... 

The onwnership and permissions of /dev/bus/usb/003/005  are root, nut and 664.

Kjell knew the answer:

 *Quote:*   

> You have to enter: 
> 
> sys-power/nut -hal
> 
> Into the file:
> ...

 

NUT is up and running again.

----------

