Project

General

Profile

Bug #9849

NUT not starting as root? Isn't loading USB drivers?

Added by Ryan McCullough about 1 month ago. Updated 3 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Nut
Target version:
-
Start date:
10/26/2019
Due date:
% Done:

0%

Estimated time:
Affected Version:
2.4.4
Affected Architecture:

Description

It looks like the NUT/UPS driver isn't loading the USB driver unless I pass the "-u root" parameter to the command:

[2.4.4-RELEASE][admin@router.nooblink.com]/root: /usr/local/sbin/upsdrvctl start
Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Generic HID driver 0.41 (2.7.4)
USB communication driver 0.33
No matching HID UPS found
Driver failed to start (exit status=1)
[2.4.4-RELEASE][admin@router.nooblink.com]/root: /usr/local/sbin/upsdrvctl -u root start
Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Generic HID driver 0.41 (2.7.4)
USB communication driver 0.33
Using subdriver: CyberPower HID 0.4

Notice how the first time I run the command it has an error, but if I run it with the "-u root" parameter, it loads successfully and sees my UPS.

Also, if I make changes via the WebUI configurator, it seems to restart/reload the service and it can't find my UPS.

History

#1 Updated by Ryan McCullough about 1 month ago

I think I found a work-around. I went into the Services > UPS and then selected the UPS Settings tab. From there, click the "Display Advanced" button.

In the ups.conf section add this line:

user = root

#2 Updated by Braden McGrath 3 days ago

Ryan McCullough wrote:

It looks like the NUT/UPS driver isn't loading the USB driver unless I pass the "-u root" parameter to the command:
[...]

Notice how the first time I run the command it has an error, but if I run it with the "-u root" parameter, it loads successfully and sees my UPS.

Also, if I make changes via the WebUI configurator, it seems to restart/reload the service and it can't find my UPS.

You should not need to do this... NUT loads the USB driver on my system fine, without specifying "user=root"
However, I did have to tell it that I have a "Local USB" UPS, set the name of the UPS (I just use "ups", because that's what Synology wants to see and my Synology is a slave/client of NUT on my pfSense machine), and I selected the "usbhid" driver under the "Driver Settings".

The only additional monkeying around I had to do was to add manual stanzas to the upsd.users section, and again this is just to make my Synology happy.
You may need to reboot the pfSense box to get it to detect the UPS though... I personally would not want a UPS daemon running as root on a box.

#3 Updated by Ryan McCullough 3 days ago

Braden McGrath wrote:

Ryan McCullough wrote:

It looks like the NUT/UPS driver isn't loading the USB driver unless I pass the "-u root" parameter to the command:
[...]

Notice how the first time I run the command it has an error, but if I run it with the "-u root" parameter, it loads successfully and sees my UPS.

Also, if I make changes via the WebUI configurator, it seems to restart/reload the service and it can't find my UPS.

You should not need to do this... NUT loads the USB driver on my system fine, without specifying "user=root"
However, I did have to tell it that I have a "Local USB" UPS, set the name of the UPS (I just use "ups", because that's what Synology wants to see and my Synology is a slave/client of NUT on my pfSense machine), and I selected the "usbhid" driver under the "Driver Settings".

The only additional monkeying around I had to do was to add manual stanzas to the upsd.users section, and again this is just to make my Synology happy.
You may need to reboot the pfSense box to get it to detect the UPS though... I personally would not want a UPS daemon running as root on a box.

Hmm, I will try restarting my pfSense appliance when I get home and see if it works without the root parameter.

Also available in: Atom PDF