Bug 2173121

Summary: Service startup does not look for USB UPS devices
Product: [Fedora] Fedora EPEL Reporter: Robert Nichols <rnichols42>
Component: nutAssignee: Michal Hlavinka <mhlavink>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: epel8CC: cra, james, mhlavink, orion, scott, smr
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Sample configuration patches to /etc/ups config files to monitor one supported USB UPS none

Description Robert Nichols 2023-02-24 02:19:50 UTC
Created attachment 1946074 [details]
Sample configuration patches to /etc/ups config files to monitor one supported USB UPS

Created attachment 1946074 [details]
Patches to /etc/ups config files to monitor one supported USB UPS

Description of problem:
The nut-driver-enumerator service is never started, and as a result the nut-monitor service cannot find the configured devices.

Version-Release number of selected component (if applicable):
nut-2.8.0-3.el8.x86_64
nut-2.8.0-8.fc37.x86_64 (same issue in Fedora 37)

How reproducible:
always

Steps to Reproduce:
1. Install the nut package on a system that has never run that package before and has a supported USB UPS connected.
2. Configure as a netserver monitoring that UPS. (Diffs of the installed config files in /etc/ups are attached for a sample configuration.)
3. Attempt to start the package by running "systemctl start nut.target".

Actual results:
The nut-monitor and nut-server services fail. Running "systemctl status nut-server.service" yields
Feb 23 19:30:06 fedora-vm.local nut-server[3262]: Can't connect to UPS [Cyber-2] (usbhid-ups-Cyber-2): No such file or directory
Feb 23 19:30:06 fedora-vm.local upsd[3262]: Can't connect to UPS [Cyber-2] (usbhid-ups-Cyber-2): No such file or directory


Expected results:
Server runs normally, with no error messages.

Additional info:
Discussed at some length in
https://github.com/networkupstools/nut/issues/1851#issuecomment-1436098681
Developer seems to believe the flaw is in the Fedora packaging.

The nut.target unit does start nut-driver.target, which one would expect might run nut-driver-enumerator.service to look for and set up the configured devices, but nut-driver.target appears to be an empty unit that never acquires any "Wants".

A workaround for the problem is running "systemctl enable nut-driver-enumerator.service", but nothing the supplied documentation suggests that this step is needed. In fact, the only mention of the enumerator service (config-notes.txt) indicates that it runs automatically.

Comment 1 Robert Nichols 2023-02-24 16:51:46 UTC
Comment on attachment 1946074 [details]
Sample configuration patches to /etc/ups config files to monitor one supported USB UPS

Modified description of attached file to make it clearer that this is just a sample configuration and not a proposed patch.

Comment 2 Stefan Radman 2023-04-17 17:19:35 UTC
I second that.
Configuring a driver in ups.conf is not enough, it seems.
As part of the driver configuration I have to run "systemctl start nut-driver-enumerator.service" at least once to create the driver instance(s) before "systemctl enable nut.target" and a "systemctl reboot".