[Nut-upsdev] Nut (git) upsdrvctl fails without "-u root start <upsname>", upsd fails on state file GID
Charles Lepple
clepple at gmail.com
Sat Dec 14 13:20:43 UTC 2013
On Dec 14, 2013, at 4:19 AM, David C. Rankin wrote:
> lsusb shows:
>
> Bus 004 Device 002: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
I am guessing that 'ls -l /dev/bus/usb/004/002' shows that the device node is not owned by the NUT gid?
> Why doesn't
> "upsdrvctl start" allow nut to find the UPS when it can find it without a
> problem with the options "-u root start <upsname>"?
The NUT USB drivers use libusb, which need read/write access to the /dev node for the UPS. The "-u root" hack tells the driver not to drop privileges from root to the 'nut' system user.
> Second why doesn't nut create the .pid files and the usbhid file with root:nut ownership?
Mostly because the "-u root" option is meant to be a temporary fix while tracking down permissions issues. Hopefully we can figure out the underlying permissions issue, and we can table that question.
> These problems have been around a while. I used nut for a long time before
> these problems popped up, and I would like to help get them solved. I know the
> hotplugging, etc. causes problems, but it is hard to understand how it used to
> work just fine and now doesn't. Let me know what else I can send, and I'm happy
> to do it.
I haven't mapped out all of the combinations, but we've heard similar issues from people running older versions of NUT (which worked when they were released) when it comes to hotplug/udev permissions on newer Linux systems.
I'm frustrated as well - all I can think is that there is some subtle change in how the kernel and udev are creating the device nodes. See:
http://thread.gmane.org/gmane.comp.monitoring.nut.user/8180
http://thread.gmane.org/gmane.comp.monitoring.nut.user/8207
Apparently the auto-generated udev rules file does not successfully set the permissions on the UPS USB device, but simpler hand-written rules often suffice.
If anyone has suggestions on udev debugging techniques (besides sprinkling the source code with log statements, which I would rather not do on a "production" system), I'm listening.
--
Charles Lepple
clepple at gmail
More information about the Nut-upsdev
mailing list