[Nut-upsdev] Tripp-Lite SU2200XLA problem (fwd)
Kelvin Ku
kelvin at telemetry-investments.com
Wed Mar 10 15:57:15 UTC 2010
On Tue, Mar 09, 2010 at 07:53:59PM -0500, Charles Lepple wrote:
>
> If so, then my original suggestion still stands: "sudo ./usbhid-ups -a
> usb"
>
I think I covered this in a previous email, but here it is anyway:
$ sudo usbhid-ups -a usb
Network UPS Tools - Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
Using subdriver: TrippLite HID 0.4
libusb_get_report: could not claim interface 0: Device or resource busy
Got disconnected by another driver: Device or resource busy
Can't initialize data from HID UPS
$ sudo usbhid-ups -a usb -u root
Network UPS Tools - Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
Using subdriver: TrippLite HID 0.4
libusb_get_report: No error
libusb_get_report: No error
libusb_get_report: No error
...
(driver loads successfully)
I see the driver is trying to access a bunch of USB devices:
$ sudo strace -e trace=file usbhid-ups -a usb
execve("/sbin/usbhid-ups", ["usbhid-ups", "-a", "usb"], [/* 81 vars */]) = 0
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib64/libcrypto.so.6", O_RDONLY) = 3
open("/usr/lib64/libusb-0.1.so.4", O_RDONLY) = 3
open("/lib64/libc.so.6", O_RDONLY) = 3
open("/lib64/libdl.so.2", O_RDONLY) = 3
open("/usr/lib64/libz.so.1", O_RDONLY) = 3
Network UPS Tools - Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
open("/etc/ups/ups.conf", O_RDONLY) = 4
open("/etc/nsswitch.conf", O_RDONLY) = 4
open("/etc/ld.so.cache", O_RDONLY) = 4
open("/lib64/libnss_files.so.2", O_RDONLY) = 4
open("/etc/passwd", O_RDONLY) = 4
open("/proc/sys/kernel/ngroups_max", O_RDONLY) = 4
open("/etc/group", O_RDONLY) = 4
chdir("/var/run/nut") = 0
open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/dev/bus/usb/001", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/dev/bus/usb/001/007", O_RDWR) = 5
open("/dev/bus/usb/001/001", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/001/001", O_RDONLY) = 5
open("/dev/bus/usb/001/002", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/001/002", O_RDONLY) = 5
open("/dev/bus/usb/001/007", O_RDWR) = 4
open("/dev/bus/usb/001/001", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/001/001", O_RDONLY) = 4
open("/dev/bus/usb/001/002", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/001/002", O_RDONLY) = 4
open("/dev/bus/usb/002", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/dev/bus/usb/002/001", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/002/001", O_RDONLY) = 5
open("/dev/bus/usb/002/001", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/002/001", O_RDONLY) = 4
open("/dev/bus/usb/001/007", O_RDWR) = 4
Using subdriver: TrippLite HID 0.4
libusb_get_report: could not claim interface 0: Device or resource busy
Got disconnected by another driver: Device or resource busy
Can't initialize data from HID UPS
unlink("/var/run/nut/usbhid-ups-usb.pid") = 0
Process 3060 detached
Of course it can't open these files for writing as non-root, since:
$ ls -l /dev/bus/usb/*
/dev/bus/usb/001:
total 0
crw-r--r-- 1 root root 189, 0 Mar 10 10:43 001
crw-r--r-- 1 root root 189, 1 Mar 10 10:44 002
crw-rw-r-- 1 root dialout 189, 6 Mar 10 10:48 007
/dev/bus/usb/002:
total 0
crw-r--r-- 1 root root 189, 128 Mar 10 10:44 001
As a test, I set write permissions on those files:
$ sudo chmod o+w /dev/bus/usb/*/*
$ ls -l /dev/bus/usb/*
/dev/bus/usb/001:
total 0
crw-r--rw- 1 root root 189, 0 Mar 10 10:43 001
crw-r--rw- 1 root root 189, 1 Mar 10 10:44 002
crw-rw-rw- 1 root dialout 189, 6 Mar 10 10:48 007
/dev/bus/usb/002:
total 0
crw-r--rw- 1 root root 189, 128 Mar 10 10:44 001
and the driver loads successfully:
$ sudo usbhid-ups -a usb
Network UPS Tools - Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
Using subdriver: TrippLite HID 0.4
libusb_get_report: No error
libusb_get_report: No error
libusb_get_report: No error
...
$ ps -ef | grep usbhid
nut 3129 1 0 10:49 ? 00:00:00 usbhid-ups -a usb
Any idea why the driver needs to write to these other USB devices?
$ lsusb
Bus 001 Device 007: ID 09ae:4004 Tripp Lite
Bus 001 Device 001: ID 0000:0000
Bus 001 Device 002: ID 0461:4d15 Primax Electronics, Ltd
Bus 002 Device 001: ID 0000:0000
001:001 and 002:001 are hubs and 001:002 is a mouse.
- Kelvin
More information about the Nut-upsdev
mailing list