Bug 488368
Summary: | usbhid-ups: "failed to detach kernel driver from USB device" | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Russell Odom <russ+bugzilla-redhat> | ||||||||
Component: | nut | Assignee: | Michal Hlavinka <mhlavink> | ||||||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||
Severity: | medium | Docs Contact: | |||||||||
Priority: | low | ||||||||||
Version: | 10 | CC: | maurizio.antillon, mhlavink | ||||||||
Target Milestone: | --- | ||||||||||
Target Release: | --- | ||||||||||
Hardware: | x86_64 | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | 2.2.2-5.fc10 | Doc Type: | Bug Fix | ||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2009-06-24 19:35:41 UTC | Type: | --- | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Attachments: |
|
Description
Russell Odom
2009-03-03 22:14:16 UTC
could you try check if usbhid-ups -u root -DD -a <name> works? <name> is name of your ups in ups.conf - in square brackets also, do you have any selinux denial messages? do you see any messages in /var/log/messages related to this? "usbhid-ups -u root -DD -a mge" is successful. When I start usbhid-ups on its own, without "-u root", /var/log/messages doesn't contain anything (and just a "Connection refused" message when I try to start NUT via the initscript), and I don't see any selinux messages. Adding "user = root" to ups.conf seems to allow it to start OK but (having amended my config to use IPv4, as upsd doesn't seem to want to listen on IPv6) upsd still can't connect until I fix a socket permission problem: [root@detritus ~]# ls -l /var/run/nut/usbhid-ups-mge srw-rw---- 1 root root 0 2009-03-14 18:44 /var/run/nut/usbhid-ups-mge [root@detritus ~]# chmod o+rw /var/run/nut/usbhid-ups-mge After doing this (after NUT startup) everything works, but obviously this is a dirty hack - but I imagine the problem will go away once we get to the bottom of why usbhid-ups needs to run as root in order to work. First, I've got the same errors when starting ups service. Then I've fully configured it and it works for me now without any errors. could you upload all your nut config files in this bz? /etc/sysconfig/ups /etc/ups/ups.conf /etc/ups/upsd.conf /etc/ups/upsd.users /etc/ups/upsmon.conf /etc/ups/upssched.conf Created attachment 335613 [details]
Config files as requested
Here's my config files. Nothing unusual here I don't think.
Your config files looks ok. I've tried to use your config files and it works for me (I've just replaced vendor and product ids) I found another interesting thing. First time service ups start is successful, but next time(s) it fails... please try (as root): 0)remove user=root from ups.conf 1)stop nut : service ups stop 2)check nothing nut related is running : ps aux | grep nut | grep -v grep 3)kill running nut related processes if there are any 4)try to start nut : service ups start if there is any problem: repeat steps 1),2),3) and attach output of usbhid-ups -DD -a mge you will need to kill it probably, first 10-20 secs is enough if there is anything in /var/log/messages attach it too thanks Output from /var/log/messages (and console) when starting then stopping NUT: Broadcast message from nut (Wed Mar 18 21:33:14 2009): Communications with UPS mge.0.1 lost Mar 18 21:33:14 detritus upsd[18695]: listening on 0.0.0.0 port 3493 Mar 18 21:33:14 detritus upsd[18695]: Can't connect to UPS [mge] (usbhid-ups-mge): No such file or directory Mar 18 21:33:14 detritus upsd[18696]: Startup successful Mar 18 21:33:14 detritus upsmon[18699]: Startup successful Mar 18 21:33:14 detritus upsd[18696]: Client monmaster.0.1 logged into UPS [mge] Mar 18 21:33:14 detritus upsmon[18700]: Poll UPS [mge.0.1] failed - Driver not connected Mar 18 21:33:14 detritus upsmon[18700]: Communications with UPS mge.0.1 lost Mar 18 21:33:14 detritus wall[18702]: wall: user nut broadcasted 1 lines (44 chars) Broadcast message from nut (Wed Mar 18 21:33:19 2009): UPS mge.0.1 is unavailable Mar 18 21:33:19 detritus upsmon[18700]: Poll UPS [mge.0.1] failed - Driver not connected Mar 18 21:33:19 detritus upsmon[18700]: UPS mge.0.1 is unavailable Mar 18 21:33:19 detritus wall[18705]: wall: user nut broadcasted 1 lines (34 chars) Mar 18 21:33:22 detritus upsmon[18700]: Signal 15: exiting Mar 18 21:33:22 detritus upsd[18696]: Signal 15: exiting The output from usbhid-ups -DD -a mge looks the same as my initial report (comment 0) above. Will attach what it looks like with "user = root" re-enabled in a minute... Created attachment 335770 [details]
usbhid-ups -DD -a mge
This is with "user = root" in ups.conf - all appears to work successfully in this case.
sorry for slow response, but I'm little overloaded last few days all these without user=root in config file 1)please add output of id nut id uucp lsusb find /dev/bus/usb/ -ls 2)in /etc/udev/rules.d/52_nut-usbups.rules try changing MODE ATTR{idVendor}=="0463", ATTR{idProduct}=="ffff", MODE="664", GROUP="uucp" to ATTR{idVendor}=="0463", ATTR{idProduct}=="ffff", MODE="666", GROUP="uucp" if it changes anything (make sure there is nothing nut related running before testing: ps aux | grep nut | grep -v grep ) Change it back to 664. 3)try to change selinux mode to permissive (if you have it in enforcing mode: sestatus) setenforce 0 try if it changes anything (make sure nut is stopped completely) and change it back to enforcing setenforce 1 1) Here's your info... [root@detritus ~]# id nut uid=57(nut) gid=57(nut) groups=57(nut),14(uucp) [root@detritus ~]# id uucp uid=10(uucp) gid=14(uucp) groups=14(uucp) [root@detritus ~]# lsusb Bus 002 Device 002: ID 2040:8400 Hauppauge Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 015: ID 05a4:9862 Ortek Technology, Inc. Bus 001 Device 014: ID 0510:0032 Sejin Electron, Inc. Bus 001 Device 013: ID 05a4:9837 Ortek Technology, Inc. Bus 001 Device 012: ID 03f0:c602 Hewlett-Packard Photosmart D7100 series Bus 001 Device 011: ID 0c45:6242 Microdia PC Camera (SN9C201 + MI1310) Bus 001 Device 009: ID 04cc:1521 Philips Semiconductors USB 2.0 Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 002: ID 0463:ffff MGE UPS Systems UPS Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub [root@detritus ~]# find /dev/bus/usb/ -ls 2477 0 drwxr-xr-x 7 root root 140 Mar 31 20:37 /dev/bus/usb/ 3722 0 drwxr-xr-x 2 root root 80 Mar 31 20:37 /dev/bus/usb/002 3795 0 crw-rw-r-- 1 root vboxusers Apr 3 12:35 /dev/bus/usb/002/002 3725 0 crw-rw-r-- 1 root vboxusers Apr 3 12:35 /dev/bus/usb/002/001 3691 0 drwxr-xr-x 2 root root 60 Mar 31 20:37 /dev/bus/usb/005 3694 0 crw-rw-r-- 1 root vboxusers Apr 3 12:35 /dev/bus/usb/005/001 2645 0 drwxr-xr-x 2 root root 180 Apr 2 21:49 /dev/bus/usb/001 9560 0 crw-rw-r-- 1 root vboxusers Apr 3 12:35 /dev/bus/usb/001/015 9434 0 crw-rw-r-- 1 root vboxusers Apr 3 12:35 /dev/bus/usb/001/014 9366 0 crw-rw-r-- 1 root vboxusers Apr 3 12:35 /dev/bus/usb/001/013 9102 0 crw-rw-r-- 1 root vboxusers Apr 3 12:35 /dev/bus/usb/001/012 8911 0 crw-rw-r-- 1 root vboxusers Apr 3 12:35 /dev/bus/usb/001/011 8740 0 crw-rw-r-- 1 root vboxusers Mar 31 19:37 /dev/bus/usb/001/009 2648 0 crw-rw-r-- 1 root vboxusers Apr 3 12:35 /dev/bus/usb/001/001 2578 0 drwxr-xr-x 2 root root 60 Mar 31 20:37 /dev/bus/usb/004 2581 0 crw-rw-r-- 1 root vboxusers Apr 3 12:35 /dev/bus/usb/004/001 2478 0 drwxr-xr-x 2 root root 80 Mar 31 20:37 /dev/bus/usb/003 2515 0 crw-rw-r-- 1 root vboxusers Apr 3 17:29 /dev/bus/usb/003/002 2481 0 crw-rw-r-- 1 root vboxusers Apr 3 12:35 /dev/bus/usb/003/001 (not quite sure why all the devices have a GID of vboxusers, which is a group created by VirtualBox - perhaps this is the root cause of my problems?) [root@detritus ~]# getent group vboxusers vboxusers:x:506:russ [root@detritus ~]# rpm -q VirtualBox VirtualBox-2.1.2_41885_fedora9-1.x86_64 2) Changing MODE appears to make no difference (I unplugged and replugged USB cable). 3) Changing selinux to permissive mode didn't help either :-( yes, it seems, it's vboxusers group related, because it should be uucp group could you test what happens if you manually change the group to uucp? in output of lsusb you'll see something like ... Bus 003 Device 002: ID 0463:ffff MGE UPS Systems UPS so we need /dev/bus/usb/003/002 to have uucp group: chmod 0660 /dev/bus/usb/003/002 chown root:uucp /dev/bus/usb/003/002 and try to start nut (without user=root) If you replug ups to other port, it'll probably be something else than ../003/002, so change the commands accordingly please add output of rpm -ql VirtualBox and attach VirtualBox's files from /lib/udev/rules.d/ and /etc/udev/rules.d/ thanks [root@detritus ~]# lsusb | grep MGE Bus 004 Device 003: ID 0463:ffff MGE UPS Systems UPS [root@detritus ~]# ls -l /dev/bus/usb/004/003 crw-rw-r-- 1 root vboxusers 189, 386 2009-05-25 20:34 /dev/bus/usb/004/003 [root@detritus ~]# chown :uucp /dev/bus/usb/004/003 [root@detritus ~]# ls -l /dev/bus/usb/004/003 crw-rw-r-- 1 root uucp 189, 386 2009-05-25 20:34 /dev/bus/usb/004/003 The ups service now starts successfully without "user = root" in ups.conf! [root@detritus ~]# rpm -ql VirtualBox | grep udev [root@detritus ~]# ls -l /etc/udev/rules.d/*-vboxdrv.rules -rw-r--r-- 1 root root 208 2009-04-03 17:47 /etc/udev/rules.d/10-vboxdrv.rules -rw-r--r-- 1 root root 208 2009-01-22 20:20 /etc/udev/rules.d/60-vboxdrv.rules [root@detritus ~]# cat /etc/udev/rules.d/10-vboxdrv.rules KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0600" SUBSYSTEM=="usb_device", GROUP="vboxusers", MODE="0664" SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="vboxusers", MODE="0664" [root@detritus ~]# cat /etc/udev/rules.d/60-vboxdrv.rules KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0600" SUBSYSTEM=="usb_device", GROUP="vboxusers", MODE="0664" SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="vboxusers", MODE="0664" Created attachment 345352 [details]
Output of "rpm -ql VirtualBox"
ok, try this (as root): 1) move nut rule to later position mv /etc/udev/rules.d/52_nut-usbups.rules /etc/udev/rules.d/62_nut-usbups.rules 2) reload udev udevcontrol --reload_rules 3) stop nut 4) re-plug your ups 5) start nut 6) check permissions of /dev/bus/usb/XXX/YYY as in comment #11 virtualbox is the broken one here, but because fedora doesn't ship virtualbox, we can't fix it. This moves nut's udev rules after the virtualbox. In udev, later rule overwrites the prev one (if special keywords are not used). If this work, I'll change this in nut package Just tried that, works a treat! [root@detritus ~]# ls -l /dev/bus/usb/004/004 crw-rw-r-- 1 root uucp 189, 387 2009-05-31 20:40 /dev/bus/usb/004/004 nut-2.4.1-6.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/nut-2.4.1-6.fc11 nut-2.2.2-5.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/nut-2.2.2-5.fc10 nut-2.2.2-5.fc10 has been pushed to the Fedora 10 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update nut'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-5921 nut-2.4.1-6.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report. nut-2.2.2-5.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report. |