Sergei V. Dubrov
2011-Jul-21 05:07 UTC
[Nut-upsuser] Udev rules troubles: incorrect ACTION expression?
G'day, all! It's my second trouble with NUT. Latest nut-2.6.1.tar.gz installed from source on Xenserver 5.6 SP2, UPS is Powercom WOW--500U FW3.A4 (USB). Problem with setting permissions for udev (described in /etc/udev/rules.d/52-nut-usbups.rules file): ACTION!="add|change", GOTO="nut-usbups_rules_end" don't work for me. Only when I changed ACTION to: ACTION!="add", GOTO="nut-usbups_rules_end" (without |change) - it's began to set correct permissions 0664 for my USB UPS device as specified in 52- nut-usbups.rules file. Default for usbdev is 0640 - it's insufficiently for non-root user: # PowerCOM WOW - usbhid-ups ATTR{idVendor}=="0d9f", ATTR{idProduct}=="00a4", MODE="664", GROUP="nut" [root at xen-home bin]# lsusb Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 002: ID 0d9f:00a4 Powercom Co., Ltd Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 002: ID 13ba:0017 Unknown PS/2 Keyboard+Mouse Adapter Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub [root at xen-home bin]# ls -la /dev/bus/usb/005 total 0 drwxr-xr-x 2 root root 80 Jul 20 17:11 . drwxr-xr-x 8 root root 160 Jul 20 17:11 .. crw-rw-r-- 1 root nut 189, 512 Jul 20 17:42 001 crw-rw-r-- 1 root nut 189, 513 Jul 21 11:55 002 May be ACTION!="add|change" has incorrect syntax? TIA, Sergei Dubrov
Petr Kubánek
2011-Jul-21 07:23 UTC
[Nut-upsuser] Udev rules troubles: incorrect ACTION expression?
Hi Sergei, you can get udev debugging using: root at host:~# /etc/init.d/udev stop root at host:~# udevd ?debug 1288130388.961886 [26940] udev_device_new_from_syspath: ? This might shed some light into syntax issues.. Petr Kub?nek Sergei V. Dubrov p??e v ?t 21. 07. 2011 v 12:07 +0700:> G'day, all! > > It's my second trouble with NUT. Latest nut-2.6.1.tar.gz installed from > source on Xenserver 5.6 SP2, UPS is Powercom WOW--500U FW3.A4 (USB). > Problem with setting permissions for udev (described in > /etc/udev/rules.d/52-nut-usbups.rules file): > > ACTION!="add|change", GOTO="nut-usbups_rules_end" don't work for me. Only > when I changed ACTION to: > > ACTION!="add", GOTO="nut-usbups_rules_end" (without |change) - it's began > to set correct permissions 0664 for my USB UPS device as specified in 52- > nut-usbups.rules file. Default for usbdev is 0640 - it's insufficiently for > non-root user: > > # PowerCOM WOW - usbhid-ups > ATTR{idVendor}=="0d9f", ATTR{idProduct}=="00a4", MODE="664", GROUP="nut" > > [root at xen-home bin]# lsusb > Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 005 Device 002: ID 0d9f:00a4 Powercom Co., Ltd > Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 004 Device 002: ID 13ba:0017 Unknown PS/2 Keyboard+Mouse Adapter > Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > > [root at xen-home bin]# ls -la /dev/bus/usb/005 > total 0 > drwxr-xr-x 2 root root 80 Jul 20 17:11 . > drwxr-xr-x 8 root root 160 Jul 20 17:11 .. > crw-rw-r-- 1 root nut 189, 512 Jul 20 17:42 001 > crw-rw-r-- 1 root nut 189, 513 Jul 21 11:55 002 > > > May be ACTION!="add|change" has incorrect syntax? > > > TIA, > Sergei Dubrov