Bug 2173121 - Service startup does not look for USB UPS devices
Summary: Service startup does not look for USB UPS devices
Keywords:
Status: NEW
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: nut
Version: epel8
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Michal Hlavinka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-24 02:19 UTC by Robert Nichols
Modified: 2023-04-17 17:19 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
Sample configuration patches to /etc/ups config files to monitor one supported USB UPS (2.69 KB, patch)
2023-02-24 02:19 UTC, Robert Nichols
no flags Details | Diff

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".


Note You need to log in before you can comment on or make changes to this bug.