Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] NUT Stopped Working After Upgrade to 2.4.3-r2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 679

PostPosted: Mon Jul 12, 2010 3:02 am    Post subject: [Solved] NUT Stopped Working After Upgrade to 2.4.3-r2 Reply with quote

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:

Code:
# /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:

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


Here are the configuration files, without all the comments:

nut.conf:
Code:
MODE = none


ups.conf:
Code:
[PW5115]
        driver = bcmxcp_usb
        port = notUsed
        desc = "Power Ware (Eaton) 5115  on runner"


upsd.conf
Code:
LISTEN 127.0.0.1 3493


upsd.users
Code:
[monuser]
                password = xxxxxxxx
                upsmon master


upsmon.conf
Code:

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
Code:
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
Back to top
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 531
Location: Australia

PostPosted: Tue Jul 13, 2010 2:47 pm    Post subject: Re: NUT Stopped Working After Upgrade to 2.4.3-r2 Reply with quote

Quote:
Code:
# /etc/init.d/upsdrv start
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)

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").
Back to top
View user's profile Send private message
idella4
Retired Dev
Retired Dev


Joined: 09 Jun 2006
Posts: 1600
Location: Australia, Perth

PostPosted: Tue Jul 13, 2010 4:32 pm    Post subject: Reply with quote

kimmie

Code:

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).

Fatal error: unusable configuration
Driver failed to start (exit status=1)
* Failed to start UPS drivers!



Quote:

ups.conf:
Code:
[PW5115]
driver = bcmxcp_usb
port = notUsed
desc = "Power Ware (Eaton) 5115 on runner"


is a clue.
See upsdrvctl(8 ) and ups.conf(5) is another clue. Time to hit the man pages.
_________________
idella4@aus
Back to top
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 531
Location: Australia

PostPosted: Tue Jul 13, 2010 4:51 pm    Post subject: Reply with quote

idella4 wrote:
kimmie


Ummm... yes? BTW his nut config is fine, port is ignored for this driver.
Back to top
View user's profile Send private message
idella4
Retired Dev
Retired Dev


Joined: 09 Jun 2006
Posts: 1600
Location: Australia, Perth

PostPosted: Tue Jul 13, 2010 5:02 pm    Post subject: Reply with quote

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:
_________________
idella4@aus
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 679

PostPosted: Sat Jul 24, 2010 4:49 pm    Post subject: Reply with quote

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:
Code:
 # 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
Code:
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:
Code:
/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:
Code:
[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.
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 679

PostPosted: Sat Jul 24, 2010 4:55 pm    Post subject: Reply with quote

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:
Code:
# /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
Code:
 # /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.
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 679

PostPosted: Sat Jul 24, 2010 9:58 pm    Post subject: Reply with quote

Quote:
Looks like some module has already claimed your USB device?


>From /proc/bus/usb/devices:
Code:
...
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?
Back to top
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 531
Location: Australia

PostPosted: Sun Jul 25, 2010 4:28 am    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 679

PostPosted: Mon Jul 26, 2010 1:22 am    Post subject: Solved Reply with quote

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:
/etc/portage/package.use
(or /etc/portage/package.use/monolithic)

So you stop nut to build the hal driver.
You may also remove the
/usr/libexec/hald-addon-bcmxcp_usb
if you don't want to re emerge the nut package.


NUT is up and running again.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum