Yesterday I upgraded one of my systems from Fedora 36 to Fedora 37. NUT
was upgraded to version 2.8.0. It no longer runs.
At first I thought it was because of the XFCE Power Manager program.
That program finds the UPS with no problem. I thought maybe the two
programs were competing for the UPS port. I shut down the XFCE power
manager, but that did not help NUT.
Based on the diagnostics given below, I think this is a permissions
problem at /run. The nut user does not have write permissions at /run.
Note that /run is linked as /var/run and the nut user DOES have write
permissions there.
How can I correct this?
======================================[root at mythtv ups]# systemctl status
nut-server
nut-server.service - Network UPS Tools - power devices information server
Loaded: loaded (/usr/lib/systemd/system/nut-server.service;
enabled; preset: disabled)
Active: active (running) since Tue 2022-11-29 06:18:13 CST; 19min ago
Main PID: 11908 (upsd)
Tasks: 1 (limit: 9482)
Memory: 736.0K
CPU: 27ms
CGroup: /system.slice/nut-server.service
??11908 /usr/sbin/upsd -F
Nov 29 06:18:13 mythtv.billgee.local upsd[11908]: Can't connect to UPS
[cyberpower] (usbhid-ups-cyberpower): No such fi>
Nov 29 06:18:13 mythtv.billgee.local nut-server[11908]: Can't connect to
UPS [cyberpower] (usbhid-ups-cyberpower): No s>
Nov 29 06:18:13 mythtv.billgee.local nut-server[11908]: Running as
foreground process, not saving a PID file
Nov 29 06:18:13 mythtv.billgee.local upsd[11908]: Running as foreground
process, not saving a PID file
Nov 29 06:23:13 mythtv.billgee.local nut-server[11908]: Can't connect to
UPS [cyberpower] (usbhid-ups-cyberpower): No such file or directory>
Nov 29 06:23:13 mythtv.billgee.local upsd[11908]: Can't connect to UPS
[cyberpower] (usbhid-ups-cyberpower): No such file or directory>
[root at mythtv ups]# usbhid-ups -a cyberpower
Network UPS Tools - Generic HID driver 0.47 (2.8.0)
USB communication driver (libusb 1.0) 0.43
writepid: fopen /var/run/usbhid-ups-cyberpower.pid: Permission denied
Using subdriver: CyberPower HID 0.6
cps_adjust_battery_scale: battery readings will be scaled by 2/3
Fatal error: unable to create listener socket
bind /var/run/usbhid-ups-cyberpower failed: Permission denied
Exiting.
[root at mythtv ups]# ll /var/run/usb*
ls: cannot access '/var/run/usb*': No such file or directory
[root at mythtv ups]# ll -d /var/run
lrwxrwxrwx. 1 root root 6 Aug 31 2014 /var/run -> ../run
[root at mythtv ups]# ll -d /run
drwxr-xr-x 55 root root 1500 Nov 28 08:22 /run
[root at mythtv ups]# tail /etc/ups/ups.conf
[cyberpower]
driver=usbhid-ups
desc="CyberPower CP1500"
port=auto
vendorid=0764
=================================================
Thanks!
--
==============Bill Gee
Jim Klimov
2022-Nov-29 23:43 UTC
[Nut-upsuser] NUT no longer works after 2.7 -> 2.8 upgrade
As recently noted in the lists, this was tracked down to a Fedora 37 packaging bug: https://bugzilla.redhat.com/show_bug.cgi? id=2127269> The nut user does not have write permissions at /run.Note that /run is linked as /var/run and the nut user DOES have write permissions there. These two statements do not fit together :) Permissions on symlink do not matter, only the ultimate object's rights do (root-owned /run). The packaging error is that (/var)/run/nut should have been used for drivers and upsd, or /var/state/ups as it should also exist and be accessible to these. For a quick fix you can set Environment=NUT_ALTPIDPATH=/var/state/ups for their systemd units or respective custom drop-in files. Jim On Tue, Nov 29, 2022, 14:06 Bill Gee <bgee at campercaver.net> wrote:> Yesterday I upgraded one of my systems from Fedora 36 to Fedora 37. NUT > was upgraded to version 2.8.0. It no longer runs. > > At first I thought it was because of the XFCE Power Manager program. > That program finds the UPS with no problem. I thought maybe the two > programs were competing for the UPS port. I shut down the XFCE power > manager, but that did not help NUT. > > Based on the diagnostics given below, I think this is a permissions > problem at /run. The nut user does not have write permissions at /run. > Note that /run is linked as /var/run and the nut user DOES have write > permissions there. > > How can I correct this? > > ======================================> [root at mythtv ups]# systemctl status nut-server > nut-server.service - Network UPS Tools - power devices information server > Loaded: loaded (/usr/lib/systemd/system/nut-server.service; > enabled; preset: disabled) > Active: active (running) since Tue 2022-11-29 06:18:13 CST; 19min ago > Main PID: 11908 (upsd) > Tasks: 1 (limit: 9482) > Memory: 736.0K > CPU: 27ms > CGroup: /system.slice/nut-server.service > ??11908 /usr/sbin/upsd -F > > Nov 29 06:18:13 mythtv.billgee.local upsd[11908]: Can't connect to UPS > [cyberpower] (usbhid-ups-cyberpower): No such fi> > Nov 29 06:18:13 mythtv.billgee.local nut-server[11908]: Can't connect to > UPS [cyberpower] (usbhid-ups-cyberpower): No s> > Nov 29 06:18:13 mythtv.billgee.local nut-server[11908]: Running as > foreground process, not saving a PID file > Nov 29 06:18:13 mythtv.billgee.local upsd[11908]: Running as foreground > process, not saving a PID file > Nov 29 06:23:13 mythtv.billgee.local nut-server[11908]: Can't connect to > UPS [cyberpower] (usbhid-ups-cyberpower): No such file or directory> > Nov 29 06:23:13 mythtv.billgee.local upsd[11908]: Can't connect to UPS > [cyberpower] (usbhid-ups-cyberpower): No such file or directory> > > [root at mythtv ups]# usbhid-ups -a cyberpower > Network UPS Tools - Generic HID driver 0.47 (2.8.0) > USB communication driver (libusb 1.0) 0.43 > writepid: fopen /var/run/usbhid-ups-cyberpower.pid: Permission denied > Using subdriver: CyberPower HID 0.6 > cps_adjust_battery_scale: battery readings will be scaled by 2/3 > > Fatal error: unable to create listener socket > > bind /var/run/usbhid-ups-cyberpower failed: Permission denied > > Exiting. > > [root at mythtv ups]# ll /var/run/usb* > ls: cannot access '/var/run/usb*': No such file or directory > > [root at mythtv ups]# ll -d /var/run > lrwxrwxrwx. 1 root root 6 Aug 31 2014 /var/run -> ../run > > [root at mythtv ups]# ll -d /run > drwxr-xr-x 55 root root 1500 Nov 28 08:22 /run > > [root at mythtv ups]# tail /etc/ups/ups.conf > [cyberpower] > driver=usbhid-ups > desc="CyberPower CP1500" > port=auto > vendorid=0764 > =================================================> > > Thanks! > -- > ==============> Bill Gee > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20221130/9182c644/attachment.htm>