TrueNAS-SCALE-22.02.1: Incorrect permissions for Network UPS Tools config files break all UPS functionality

Description

After configuring the UPS service (System Settings > Services > UPS), the nut-server service refuses to start, citing permission issues:

● nut-server.service - Network UPS Tools - power devices information server
Loaded: loaded (/lib/systemd/system/nut-server.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2022-05-05 23:25:20 PDT; 2min 19s ago

May 05 23:25:20 truenas upsd[5882]: listening on ::1 port 3493
May 05 23:25:20 truenas upsd[5882]: listening on 127.0.0.1 port 3493
May 05 23:25:20 truenas upsd[5882]: listening on ::1 port 3493
May 05 23:25:20 truenas upsd[5882]: listening on 127.0.0.1 port 3493
May 05 23:25:20 truenas upsd[5882]: Can't open /etc/nut/ups.conf: Can't open /etc/nut/ups.conf: Permission denied
May 05 23:25:20 truenas upsd[5882]: Can't open /etc/nut/ups.conf: Can't open /etc/nut/ups.conf: Permission denied
May 05 23:25:20 truenas upsd[5882]: Network UPS Tools upsd 2.7.4
May 05 23:25:20 truenas systemd[1]: nut-server.service: Control process exited, code=exited, status=1/FAILURE
May 05 23:25:20 truenas systemd[1]: nut-server.service: Failed with result 'exit-code'.
May 05 23:25:20 truenas systemd[1]: Failed to start Network UPS Tools - power devices information server.

Looking at the permissions, it seems all the NUT config files are owed by root:ladvd:

~ % ls -l /etc/nut
rr---- 1 root ladvd 15 May 7 16:43 nut.conf
rr---- 1 root ladvd 53 May 7 16:43 ups.conf
rr---- 1 root ladvd 39 May 7 16:43 upsd.conf
rr---- 1 root ladvd 107 May 7 16:43 upsd.users
rr---- 1 root ladvd 493 May 7 16:43 upsmon.conf
rr---- 1 root ladvd 563 May 7 16:43 upssched.conf

Based on this thread: UPS Service Access Denied , it seems like the group differs ("gluster" in that case), but it's never the "nut" user that nut-server runs as.

If I change the group for all the config files, then restart nut-server, everything works:

chown root:nut /etc/nut*
systemctl restart nut-server.service

However, the permissions reset whenever the server is rebooted, breaking nut-server again. To keep my UPS integration on my own servers, I've had to create a startup task to fix the permissions and restart NUT after every reboot.

Problem/Justification

None

Impact

None

Activity

Show:

Bonnie Follweiler May 10, 2022 at 12:48 PM

Thank you .

I have moved this ticket into our queue to review.

An engineering representative will update with any further questions or details in the near future.

Former user May 10, 2022 at 4:00 AM

Done!

Bonnie Follweiler May 9, 2022 at 4:32 PM

Thank you for the report, .

Can you please attach a debug file to the "Private Attachments" section of this ticket?

To generate a debug file on TrueNAS SCALE, log in to the TrueNAS web interface, go to System Settings > Advanced, then click Save Debug and wait for the file to download to your local system.

Duplicate

Details

Assignee

Reporter

Labels

Impact

High

Time remaining

0m

Components

Fix versions

Affects versions

Priority

Katalon Platform

Created May 8, 2022 at 12:07 AM
Updated July 6, 2022 at 9:02 PM
Resolved May 10, 2022 at 4:18 PM