Running an Ubuntu Server on a Eaton 3S 700VA UPS. The Eaton's USB connection goes into my Ubuntu Server. I'm trying to use NUT to manage the UPS.
After sudo su
'ing
cat /etc/nut/ups.conf
:
[eaton]
driver = usbhid-ups
port = auto
desc = "Eaton 3S"
upsdrvctl -t start
Network UPS Tools - UPS driver controller 2.6.1
*** Testing mode: not calling exec/kill
0.000000
0.000805 Starting UPS: eaton
0.000955 exec: /lib/nut/usbhid-ups -a eaton
upsdrvctl start
Network UPS Tools - UPS driver controller 2.6.1
Network UPS Tools - Generic HID driver 0.35 (2.6.1)
USB communication driver 0.31
Can't claim USB device [0463:ffff]: could not detach kernel driver from interface 0: Operation not permitted
Driver failed to start (exit status=1)
While I do not claim to be an expert here, I am concerned that this answer will not result in a persistent permission change over a reboot, and/or the usb cable from the UPS gets moved to a different port.
Following the information from here: Musings of the Nannerpuss: NUT - Network UPS Tools - on Ubuntu .
"... The problem involves the fact that Ubuntu mounts the device as owned by root, but the nut daemon drops to an unprivileged account that doesn't have the necessary access. The simple fix is to use udev to adjust the device permissions.
Connect the device and (as root) run lsusb and locate it. Note the Bus and Device IDs as well as the Vendor:Product ID pair...."
using output as in above answer:
again from the link "... You can create a udev rule that controls the mount behavior at boot: ..." (edited to match this scenario better)"
for example
The rule watches for USB device additions with a vendor and product that match the UPS. It then sets the mode to 0660 and the group to nut instead of the default root.
Note that this answer uses 660 permission rather than 666 since that should be sufficient and more secure.
Reload udev (reboot, or perhaps unplugging then re plugging the usb cable from the UPS at the pc port), then disconnect and reconnect the device and test that the new permissions are correct. I an unclear on this part. In any case, once the nut user group has read and write on the device, it should be able to start successfully.
The udev rules.d edit did work on my 12.04.2 system even when I moved the USB cable to a different port, resulting in different Bus Device numbers on the lsusb output. Udev handled all without intervention. In fact, I may not have had to reboot when I moved it but can't remember for sure and will leave that testing to someone else.
You can use
lsusb
to find out the bus and device numberThen change permission to the device
For example
regarding this error:
The NUT FAQ at http://www.networkupstools.org/docs/FAQ.html has this (emphasis mine):
That trick worked for me.
As ndemou said, the NUT FAQ is aware of the problem, and a patch as been released, correcting the bug. But old stable distros could be affected. Hopefully, the solution is very simple...
From the NUT FAQ : "My USB UPS is supported but doesn’t work!" :
Looking further to the Github issue give me the solution :
If you are away from the USB cord of your UPS (plugging the fresh new UPS and doing the config months later because you lack time), and restarting your machine is not an option, you can retrigger the udev rules:
Does the job.