Hi Joey,

2007/1/30, Joey Hess <[EMAIL PROTECTED]>:
Package: nut-usb
Version: 2.0.5-1
Severity: normal

My computer has several usbhid devices:

[EMAIL PROTECTED]:/etc/udev/rules.d>ls -l /dev/usb
total 0
crw-rw---- 1 root root 180, 96 Jan 30 14:26 hiddev0
crw-rw-r-- 1 root nut  180, 97 Jan 30 14:36 hiddev1
crw-rw---- 1 root root 180, 98 Jan 30 14:26 hiddev2
crw-rw---- 1 root lp   180,  0 Jan 30 14:26 lp0

It's impossible to predict what the device will be to hardcode it for the
hidups driver in in ups.conf. And newhidups with its probing doesn't seem
 to work.

There's a really easy fix for this, if you know udev. Just add this to the
end of 025_nut-usbups.rules, just before the ending LABEL:

GROUP=="nut", NAME="ups%n"

Now UPSes show up as /dev/ups1 etc.

Please consider doing this by default. Even systems that arn't bitten by
it currently can be: as soon as a second USB hid device is plugged in, their
nut can easily stop working at the next reboot. That can be bad.. Of course
there is an upgrade path issue, but I think it can be done.

If you decide not to do it by default, please at least document how to do it
in the package so that people who don't grok USB have a chance of getting
it working. Thanks..

well, newhidups is the way to go, since hidups (and its /dev/hidevX)
will be superceed in nut 2.2 release.

Though your proposition is interesting (and I've already thought about
the same when I made the initial hotplug 2 udev transition), newhidups
already offers the means (regex matching) to address the right unit,
using ie:

      vendor=regex
      product=regex
      serial=regex
      vendorid=regex
      productid=regex
      bus=regex

             Examples:

                 -x vendor="Foo.Corporation.*"

                 -x vendorid=051d (APC)

                 -x product=".*(Smart|Back)-?UPS.*"

for more info, have a look at the newhidups manpage.
Note that I've not, for the moment, considered this approach since it
is a less stable way to address an exact unit than the regex way
above.

Anyway, I'll leave this bug open for further investigation.

thanks for your report,
Arnaud
--
Linux / Unix Expert - MGE UPS SYSTEMS - R&D Dpt
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://people.debian.org/~aquette/
OpenSource Developer - http://arnaud.quette.free.fr/


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to