Bug 2148706

Summary: nut still wants to write PID files in /var/run
Product: [Fedora] Fedora Reporter: dominique
Component: nutAssignee: Charles R. Anderson <cra>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 37CC: cra, crow, james, mhlavink, orion, scott
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-12-03 17:33:57 UTC 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:

Description dominique 2022-11-27 09:48:49 UTC
Description of problem:
nut fails to start

Version-Release number of selected component (if applicable):
nut-2.8.0-4.fc37

How reproducible:
always

Steps to Reproduce:
1. systemctl start nut-monitor.service nut-server.service
2.
3.

Actual results:
nut-monitor[1903]: writepid: fopen /var/run/upsmon.pid: Permission denied
upsd[1883]: Can't connect to UPS [APC] (usbhid-ups-APC): No such file or directory
nut-monitor[1903]: Poll UPS [apc@localhost] failed - Driver not connected

Expected results:
upsd[1887]: Connected to UPS [APC]: usbhid-ups-APC

Additional info:
nut-2.8.0-4 wants to write PID files in /var/run, but don't have the permissions to do so. Building nut-2.8.0-5 (f38 actually) for f37 should solve the issue.

Comment 1 dominique 2022-11-29 09:50:18 UTC
So I installed nut-2.8.0-5 nut-client-2.8.0-5 nut-cgi-2.8.0-5 from https://kojipkgs.fedoraproject.org//packages/nut/2.8.0/5.fc35/x86_64/

I started systemd services, It didn't worked right away. My log file was cluttered with permissions issues.

I eventually found that /run/nut didn't had the rights permissions and had a spurious /run/nut/nut directory with the right permissions.

Once I had changed /run/nut with the right permissions (nut:dialout 755), I was able to start nut services without any trouble.

So, in order to make it permanent, I just had to edit /usr/lib/tpmfiles/d/nut-common.conf this way:

    State file (e.g. upsd to driver) and pidfile location for NUT:                                                                                                                                      
    d /run/nut/ 0755 nut dialout - -
    X /run/nut/

--
Dom

Comment 2 Charles R. Anderson 2022-12-03 17:33:57 UTC

*** This bug has been marked as a duplicate of bug 2143442 ***