Dear Nutters, I am trying to get NUT as supplied with SuSE 10.1 working and I think I have a USB problem, possibly due to some missing startup scripts concerning permissions. The machine sees the USB device as per /var/log/messages: Jun 5 16:28:27 silver-server kernel: usb 2-1: new low speed USB device using uhci_hcd and address 7 Jun 5 16:28:27 silver-server kernel: usb 2-1: new device found, idVendor=0592, idProduct=0002 Jun 5 16:28:27 silver-server kernel: usb 2-1: new device strings: Mfr=1, Product=2, SerialNumber=0 Jun 5 16:28:27 silver-server kernel: usb 2-1: Product: Powerware UPS Jun 5 16:28:27 silver-server kernel: usb 2-1: Manufacturer: Powerware Jun 5 16:28:27 silver-server kernel: usb 2-1: configuration #1 chosen from 1 choice -------------------------------------------------- Trying to start the driver as per SuSE docs fails: # /etc/init.d/upsd start Starting NUT UPS drivers failed starting the driver manually however with user root apparently succeeds: # /usr/lib/ups/driver/bcmxcp_usb -a myups -DDDDD -u root Network UPS Tools - BCMXCP UPS driver 0.10 (2.0.3) debug level is '5' Model = POWERWARE UPS 1000VA Firmware = 00.50 Shutdown delay = 60 seconds Index Offset Format NUT 0027 0000 51 output.frequency 0028 0004 51 input.frequency 0033 0008 51 battery.voltage 0041 0012 f0 None 0043 0016 f0 None 0047 0020 f0 None 0056 0024 f0 input.voltage 0065 0028 51 output.current 0068 0032 51 None 0078 0036 f0 output.voltage Length of alarm map: 24 Index Alarm Supported -001 INVERTER_AC_OVER_VOLTAGE No -001 INVERTER_AC_UNDER_VOLTAGE No -001 INVERTER_OVER_OR_UNDER_FREQ No <snip> -001 AUTO_OFF_COMMAND_EXECUTED No -001 AUTO_ON_COMMAND_EXECUTED No 0010 BATTERY_TEST_FAILED Yes dstate_init: sock /var/lib/ups/bcmxcp_usb-auto open on fd 6 (is the driver meant to do more than just be open ?) ---------------------------------------------------------------------- The man entry for bcmxcp_usb(8) states i.a. : You also need to install manually the hotplug files (libhidups and libhid.usermap), generally in etc/hotplug/usb/, to address the permission settings problem. Lastly note that the libhidups file must have execution flag set . The files libhidups and libhid.usermap do not exist anywhere on the system, and neither does the /etc/hotplug directory and /proc/bus/usb is empty but a trawl through the nut sources reveals that libhidups is a small script which changes the permissions and ownership of a USB device. I suspect therefore that I have permissions problems and / or missing usb script(s) A few hints towards further progress would be gratefully received. Gary
On Mon, 5 Jun 2006, Gary and Jane Pearce wrote:> I am trying to get NUT as supplied with SuSE 10.1 working and I think I > have a USB problem, possibly due to some missing startup scripts > concerning permissions.Just a passing thought - What result does the command /sbin/resmgr list provide? Does it include a line such as rw-- usb:vendor=0x04b8,product=0x0128 With release 10.0, SuSE changed their resmgr policy from "works unless forbidden" to "forbidden unless specified". Scanners have this problem, see http://en.opensuse.org/SDB:Scanner_Setup_from_SUSE_Linux_10.0 . Roger
Roger Price suggested:> Just a passing thought - What result does the command /sbin/resmgr list > provide? Does it include a line such as>rw-- usb:vendor=0x04b8,product=0x0128Which must be a pointer to the answer as resmgr reports to me: # /sbin/resmgr list status code 200 server message follows: no devices available whereas lsusb reports: # /usr/sbin/lsusb Bus 005 Device 001: ID 0000:0000 Bus 003 Device 001: ID 0000:0000 Bus 001 Device 001: ID 0000:0000 Bus 002 Device 007: ID 0592:0002 Powerware Corp. Bus 002 Device 001: ID 0000:0000 Bus 004 Device 001: ID 0000:0000 The article he suggests ( http://en.opensuse.org/SDB:Scanner_Setup_from_SUSE_Linux_10.0 ) Indicates the need to add the device using resmgr, but here my complete ignorance of modern resource management shows: # /sbin/resmgr add usb:vendor=0x0592,product=0x0002 ups status code 500 server message follows: no such class: ups OK then how about: # /sbin/resmgr add usb:vendor=0592,product=0x0002 usb success Not really a success however: # /sbin/resmgr list status code 200 server message follows: no devices available So I am uncertain of where to turn next. Its also interesting to note that scanners have the add performed by Yast which automagically puts the add line into /etc/resmgr.conf.d/50-scanner.conf but there appears to be no ups config utility for doing the same thing in yast or anywhere else and presumably one day in the future there should be ? Or have I just not found it ? A pointer to an article explaining the arcane ins and outs of usb would also be appreciated as I reckon its probably now mandatory bedtime reading. Thanks for the help so far Gary
Well thanks to some helpful responses to Brendan's question I tried manually setting the permissions of /dev/bus/usb/002/002 and this allows upsmon and upsd to start correctly and apparently behave (system reports mains failure and restoration which is as far as I have tested so far). Unfortunately adding the lines: # Powerware - bcmxcp_usb SYSFS{idVendor}=="0592", SYSFS{idProduct}=="0002", MODE="660", GROUP="nut" (second line should not be wrapped of course) to a file called 77-usbups.rules in the directory /etc/udev/rules.d (which has lots of rules files in it) does not seem to do it for SuSE 10.1 (the format of the existing files there looks a little different) and of course there is no guarantee that the device currently in use will be the one that remains in use (unplugging the usb and replugging it changes the device for instance) so I do need to address this permissions issue in the longer term. Any hints ? And again many thanks for the help so far. Gary
Thank you Kjell, The permissions scripts (hotplug-ng) are missing from the SuSE 10.1 distribution. In the end I downloaded the sources to get the script I needed then discovered your solution of adding the following lines: # Powerware - bcmxcp_usb SYSFS{idVendor}=="0592", SYSFS{idProduct}=="0002", MODE="660", GROUP="nut" in a file called: /etc/udev/rules.d/77-usbups.rules did the trick once I found the typo I managed to introduce from your post :-( Its a shame the 10.1 docs still refer to hotplug that caused a lengthy distraction. The above seems to be the only addition required to the standard 10.1 distribution. Now to get on with checking that it does its shut down the way its supposed to ! Many Thanks Gary Pearce