Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 207559 - sys-power/nut-2.0.5-r2 udev rules don't work quite right
Summary: sys-power/nut-2.0.5-r2 udev rules don't work quite right
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-26 14:58 UTC by David Stutzman
Modified: 2008-07-05 03:18 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Stutzman 2008-01-26 14:58:05 UTC
SUBSYSTEM=="usb", ACTION=="add", SYSFS{idVendor}=="051d", SYSFS{idProduct}=="0002", MODE="664", GROUP="nut"

Apparently the SUBSYSTEM changed from "usb_device" to "usb".  The rules stopped working on my machine and I changed usb_device to usb and now the rule is working.  The nut ups driver service wasn't starting because the device /dev/usb/hiddev0 was root:root.  
# /etc/init.d/upsdrv start
 * Starting UPS drivers ...
Network UPS Tools - UPS driver controller 2.0.5
Network UPS Tools: HID UPS driver 0.13 (2.0.5)

Warning: This is an experimental driver.
Some features may not function correctly.

hiddev path open /dev/usb/hiddev0: Permission denied
Driver failed to start (exit status=1)
 * Failed to start UPS drivers!             

The rule is supposed to change the group to nut which allows the nut ups driver service to talk to the device and start up successfully.

Reproducible: Always

Steps to Reproduce:
1. boot machine and check permissions on /dev/usb/hiddev0 device that the UPS is detected as
2. 
3.

Actual Results:  
# ls -l /dev/usb/hiddev0
crw-rw-r-- 1 root root 180, 96 2008-01-26 08:34 /dev/usb/hiddev0


Expected Results:  
# ls -l /dev/usb/hiddev0
crw-rw-r-- 1 root nut 180, 96 2008-01-26 08:34 /dev/usb/hiddev0


I don't know enough about sysfs and kernel, but maybe the newer kernels changed how the device is categorized from usb_device to just usb and now the rules aren't  matching anymore.
Comment 1 David Stutzman 2008-01-26 15:00:29 UTC
The first line is the rule I added to /etc/udev/rules.d/70-nut-usbups.rules to make it match properly and adjust the permissions successfully.
Comment 2 David Stutzman 2008-01-31 04:13:15 UTC
kernel info:
# uname -rm
2.6.23-gentoo-r6 x86_64

It's been like this for a few kernel versions now, at least since the 2.6.22 series.  I can't remember exactly when it started to not work anymore.
Comment 3 Javier Miqueleiz 2008-02-22 12:29:52 UTC
It seems USB device-class devices were deprecated in 2.6.22 (kernel option CONFIG_USB_DEVICE_CLASS).

More details here: http://thread.gmane.org/gmane.comp.monitoring.nut.devel/2591

Have tried the patch proposed by Arnaud Quette and works for me. BTW, it's already included in nut-2.2.1.

Compiling the kernel witch CONFIG_USB_DEVICE_CLASS support should also resolve the problem. But haven't tried as the other option it's the better one.

Hope this helps a bit.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-07-05 03:18:15 UTC
2.2.2 is in the tree now, so this is obsolete I think