[Nut-upsuser] USB problems
clepple at gmail.com
Tue May 11 11:20:38 UTC 2010
On Tue, May 11, 2010 at 12:53 AM, James <bjlockie at lockie.ca> wrote:
> On 05/10/10 23:25, Charles Lepple wrote:
>> On Mon, May 10, 2010 at 11:02 PM, James<bjlockie at lockie.ca> wrote:
>>> On 05/10/10 22:09, Charles Lepple wrote:
>>>> On Mon, May 10, 2010 at 8:35 PM, James<bjlockie at lockie.ca> wrote:
>>>>> 0.000663 failed to claim USB device: could not claim interface 0:
>>>>> Operation not permitted
>>>>> 0.000671 failed to detach kernel driver from USB device: could
>>>>> detach kernel driver from interface 0: Operation not permitted
>>>> This error is different ("operation not permitted" versus "Device or
>>>> resource busy"). Is your source build using a different user than the
>>>> Gentoo build? (Some distributions have a specific NUT userid instead
>>>> of using "nobody" - not sure how they do it in Gentoo).
>>> I'm compiling it with root but I followed the instructions (I think):
>>> ./configure --with-user=ups --with-group=nut
>>> What user should perform the #8 step, /usr/local/ups/bin/upsdrvctl start
>> You can run upsdrvctl as root, and the driver will change to the user
>> you listed above. If you change the parameters to ./configure, you
>> will need to run "make clean" before "make all" and/or "make install"
>> The key is to make sure that the installed udev files match that
>> username as well. (At the beginning of this thread, you quoted a udev
>> rule which set the USB device node to user "nobody", which probably
>> isn't in group "nut".)
> I changed that.
> Is there any way to see what these two devices are?
> May the UPS one should be root:nut
> $ ls -l /dev/usb
> total 0
> crw-rw---- 1 root root 180, 96 May 11 00:40 hiddev0
> crw-rw---- 1 root root 180, 97 May 11 00:40 hiddev1
The only USB device nodes that matter for NUT are the ones that libusb
uses; namely the ones under /dev/bus/usb (older systems used a
subdirectory of /proc). The /dev/usb/hiddev* nodes usually go away
after the driver starts successfully.
You posted the output of lsusb earlier and it said "Bus 2 Device 4".
That probably means the device node of interest is
/dev/bus/usb/002/004. Note that this will change when you unplug the
UPS or restart the system; hence the udev rules.
> I changed code in drivers/libusb.c
> It doesn't fix my problems but I think is nicer code.
We would certainly like to take a look at those changes.
- Charles Lepple
More information about the Nut-upsuser