<div dir="ltr"><div>The `nut-server` (upsd) should be looking for pipe-files from drivers in the "STATEPATH" (should be `/run/nut` in your case as the driver got set up like this now).<br></div><div><br></div><div>The `/var/run is world readable` complaint indicates the `upsd` looks in `/var/run`rather than `(/var)/run/nut`.</div><div><br></div><div>While debugging startups, it may help to set non-zero `debug_min` so the daemons (data server, drivers, upsmon) would be more verbose in their systemd journals:</div><div>* <a href="https://github.com/networkupstools/nut/blob/035ae79dc28a04c443f110bd7046aab3c504319b/conf/upsd.conf.sample#L152">https://github.com/networkupstools/nut/blob/035ae79dc28a04c443f110bd7046aab3c504319b/conf/upsd.conf.sample#L152</a></div><div>
* <a href="https://github.com/networkupstools/nut/blob/035ae79dc28a04c443f110bd7046aab3c504319b/conf/upsmon.conf.sample.in#L447">https://github.com/networkupstools/nut/blob/035ae79dc28a04c443f110bd7046aab3c504319b/conf/upsmon.conf.sample.in#L447</a>
<br>* <a href="https://github.com/networkupstools/nut/blob/035ae79dc28a04c443f110bd7046aab3c504319b/docs/man/ups.conf.txt#L143">https://github.com/networkupstools/nut/blob/035ae79dc28a04c443f110bd7046aab3c504319b/docs/man/ups.conf.txt#L143</a></div><div>* <a href="https://github.com/networkupstools/nut/blob/035ae79dc28a04c443f110bd7046aab3c504319b/docs/man/ups.conf.txt#L281">https://github.com/networkupstools/nut/blob/035ae79dc28a04c443f110bd7046aab3c504319b/docs/man/ups.conf.txt#L281</a></div><div><br></div><div>Hope this helps,</div><div>Jim Klimov</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 1, 2022 at 1:14 PM Bill Gee <<a href="mailto:bgee@campercaver.net">bgee@campercaver.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Simon -<br>
<br>
I modified /usr/lib/tmpfiles.d/nut-client to use /run instead of <br>
/var/run. I checked the startup status of the nut services.<br>
<br>
=================<br>
[root@mythtv ~]# systemctl list-unit-files | grep -i nut<br>
nut-driver-enumerator.path <br>
enabled disabled<br>
nut-driver-enumerator.service <br>
enabled disabled<br>
nut-driver@.service <br>
indirect disabled<br>
nut-monitor.service <br>
disabled disabled<br>
nut-server.service <br>
enabled disabled<br>
nut-driver.target <br>
disabled disabled<br>
nut.target <br>
disabled disabled<br>
==========================<br>
<br>
I did a shutdown/reboot on the system. The usbhid driver loaded without <br>
errors and did not complain about /var/run. /run/nut exists and <br>
contains the expected two files.<br>
<br>
nut-server also started since it is set to "enabled", but failed to <br>
connect to the driver. It complains about "no such file or directory". <br>
What file is it looking for? I ran journalctl on it but got nothing <br>
more than what systemctl status reports.<br>
<br>
===========================<br>
[root@mythtv ~]# systemctl status nut-driver@cyberpower<br>
● nut-driver@cyberpower.service - Network UPS Tools - device driver for <br>
NUT device 'cyberpower'<br>
Loaded: loaded (/usr/lib/systemd/system/nut-driver@.service; <br>
enabled; preset: disabled)<br>
Drop-In: /etc/systemd/system/nut-driver@.service.d<br>
└─environ.conf<br>
/etc/systemd/system/nut-driver@cyberpower.service.d<br>
└─nut-driver-enumerator-generated-checksum.conf, <br>
nut-driver-enumerator-generated.conf<br>
Active: active (running) since Thu 2022-12-01 05:56:04 CST; 9min ago<br>
Process: 712 ExecStartPre=/usr/bin/systemd-tmpfiles --create <br>
/usr/lib/tmpfiles.d/nut-client.conf (code=exited, stat><br>
Process: 719 ExecStart=/bin/sh -c <br>
NUTDEV="`/usr/libexec/nut-driver-enumerator.sh --get-device-for-service <br>
cyberpowe><br>
Main PID: 791 (usbhid-ups)<br>
Tasks: 1 (limit: 9482)<br>
Memory: 2.9M<br>
CPU: 113ms<br>
CGroup: <br>
/system.slice/system-nut\x2ddriver.slice/nut-driver@cyberpower.service<br>
└─791 /usr/sbin/usbhid-ups -a cyberpower<br>
<br>
Dec 01 05:56:04 mythtv.billgee.local nut-driver@cyberpower[787]: Using <br>
subdriver: CyberPower HID 0.6<br>
Dec 01 05:56:04 mythtv.billgee.local nut-driver@cyberpower[787]: Network <br>
UPS Tools - Generic HID driver 0.47 (2.8.0)<br>
Dec 01 05:56:04 mythtv.billgee.local nut-driver@cyberpower[787]: USB <br>
communication driver (libusb 1.0) 0.43<br>
Dec 01 05:56:04 mythtv.billgee.local nut-driver@cyberpower[787]: <br>
cps_adjust_battery_scale: battery readings will be sca><br>
Dec 01 05:56:04 mythtv.billgee.local nut-driver@cyberpower[719]: Network <br>
UPS Tools - UPS driver controller 2.8.0<br>
Dec 01 05:56:04 mythtv.billgee.local usbhid-ups[791]: Startup successful<br>
<br>
[root@mythtv ~]# systemctl status nut-server<br>
● nut-server.service - Network UPS Tools - power devices information server<br>
Loaded: loaded (/usr/lib/systemd/system/nut-server.service; <br>
enabled; preset: disabled)<br>
Active: active (running) since Thu 2022-12-01 05:56:07 CST; 9min ago<br>
Main PID: 809 (upsd)<br>
Tasks: 1 (limit: 9482)<br>
Memory: 1000.0K<br>
CPU: 15ms<br>
CGroup: /system.slice/nut-server.service<br>
└─809 /usr/sbin/upsd -F<br>
<br>
Dec 01 05:56:08 mythtv.billgee.local upsd[809]: listening on ::1 port 3493<br>
Dec 01 05:56:08 mythtv.billgee.local upsd[809]: listening on 127.0.0.1 <br>
port 3493<br>
Dec 01 05:56:08 mythtv.billgee.local nut-server[809]: /var/run is world <br>
readable<br>
Dec 01 05:56:08 mythtv.billgee.local nut-server[809]: Can't connect to <br>
UPS [cyberpower] (usbhid-ups-cyberpower): No suc><br>
Dec 01 05:56:08 mythtv.billgee.local upsd[809]: /var/run is world readable<br>
Dec 01 05:56:08 mythtv.billgee.local upsd[809]: Can't connect to UPS <br>
[cyberpower] (usbhid-ups-cyberpower): No such file><br>
Dec 01 05:56:10 mythtv.billgee.local nut-server[809]: Running as <br>
foreground process, not saving a PID file<br>
Dec 01 05:56:10 mythtv.billgee.local upsd[809]: Running as foreground <br>
process, not saving a PID file<br>
Dec 01 06:01:08 mythtv.billgee.local nut-server[809]: Can't connect to <br>
UPS [cyberpower] (usbhid-ups-cyberpower): No suc><br>
Dec 01 06:01:08 mythtv.billgee.local upsd[809]: Can't connect to UPS <br>
[cyberpower] (usbhid-ups-cyberpower): No such file><br>
================================<br>
<br>
<br>
<br>
===============<br>
Bill Gee<br>
<br>
On 11/30/22 21:14, Simon Wilson via Nut-upsuser wrote:<br>
> ----- Message from Bill Gee <<a href="mailto:bgee@campercaver.net" target="_blank">bgee@campercaver.net</a>> ---------<br>
> Date: Wed, 30 Nov 2022 19:26:46 -0600<br>
> From: Bill Gee <<a href="mailto:bgee@campercaver.net" target="_blank">bgee@campercaver.net</a>><br>
> Subject: Re: [Nut-upsuser] NUT no longer works after 2.7 -> 2.8 upgrade<br>
> To: <a href="mailto:nut-upsuser@alioth-lists.debian.net" target="_blank">nut-upsuser@alioth-lists.debian.net</a><br>
> <br>
> <br>
>> Hi Simon -<br>
>><br>
>> I ran through the steps you gave below. To quote Gilbert&Sullivan ... <br>
>> "Modified Rapture!" I suppose I should try a reboot to make sure <br>
>> everything starts properly.<br>
> <br>
> Not yet with the reboot. Baby steps... :) you have a driver running from <br>
> the service file! Celebrations are in order.<br>
> <br>
> Did you need to add the environment drop-in file? At which step did it <br>
> work?<br>
> <br>
>> But first, there is a problem with upsc. Also nut-server complains <br>
>> that it cannot connect to the device.<br>
> <br>
> Ok, that's next... your comments are wrong way around :) nut-server not <br>
> starting is why upsc doesn't give you anything.<br>
> <br>
>><br>
>> /run/nut exists and contains two files.<br>
>><br>
>> Here are some outputs:<br>
>><br>
>> ======================================<br>
>> [root@mythtv ~]# journalctl -u nut-driver@cyberpower.service -f<br>
>> Nov 30 19:00:20 mythtv.billgee.local systemd[1]: Starting <br>
>> nut-driver@cyberpower.service - Network UPS Tools - device driver for <br>
>> NUT device 'cyberpower'...<br>
>> Nov 30 19:00:20 mythtv.billgee.local systemd-tmpfiles[28689]: <br>
>> /usr/lib/tmpfiles.d/nut-client.conf:2: Line references path below <br>
>> legacy directory /var/run/, updating /var/run/nut → /run/nut; please <br>
>> update the tmpfiles.d/ drop-in file accordingly.<br>
> <br>
> That line is the "noise" error I mentioned. Edit <br>
> /usr/lib/tmpfiles.d/nut-client.conf to read /run/nut, not /var/run/nut<br>
> <br>
>> Nov 30 19:00:20 mythtv.billgee.local systemd-tmpfiles[28689]: <br>
>> /usr/lib/tmpfiles.d/nut-client.conf:3: Line references path below <br>
>> legacy directory /var/run/, updating /var/run/nut → /run/nut; please <br>
>> update the tmpfiles.d/ drop-in file accordingly.<br>
> <br>
> Ditto, although you probably don't need line 3 in the file anyway.<br>
> <br>
>> Nov 30 19:00:21 mythtv.billgee.local nut-driver@cyberpower[28719]: <br>
>> Using subdriver: CyberPower HID 0.6<br>
>> Nov 30 19:00:21 mythtv.billgee.local nut-driver@cyberpower[28719]: <br>
>> Network UPS Tools - Generic HID driver 0.47 (2.8.0)<br>
>> Nov 30 19:00:21 mythtv.billgee.local nut-driver@cyberpower[28719]: USB <br>
>> communication driver (libusb 1.0) 0.43<br>
>> Nov 30 19:00:21 mythtv.billgee.local nut-driver@cyberpower[28719]: <br>
>> cps_adjust_battery_scale: battery readings will be scaled by 2/3<br>
>> Nov 30 19:00:21 mythtv.billgee.local usbhid-ups[28769]: Startup <br>
>> successful<br>
>> Nov 30 19:00:21 mythtv.billgee.local nut-driver@cyberpower[28691]: <br>
>> Network UPS Tools - UPS driver controller 2.8.0<br>
>> Nov 30 19:00:21 mythtv.billgee.local systemd[1]: Started <br>
>> nut-driver@cyberpower.service - Network UPS Tools - device driver for <br>
>> NUT device 'cyberpower'.<br>
>><br>
>> [root@mythtv ups]# ll /run/nut<br>
>> total 4<br>
>> srw-rw---- 1 nut nut 0 Nov 30 19:00 usbhid-ups-cyberpower<br>
>> -rw-r--r-- 1 nut nut 6 Nov 30 19:00 usbhid-ups-cyberpower.pid<br>
>><br>
>><br>
>> [root@mythtv ups]# systemctl --no-pager --full status nut-server<br>
>> ● nut-server.service - Network UPS Tools - power devices information <br>
>> server<br>
>> Loaded: loaded (/usr/lib/systemd/system/nut-server.service; <br>
>> enabled; preset: disabled)<br>
>> Active: active (running) since Wed 2022-11-30 19:06:53 CST; 13min <br>
>> ago<br>
>> Main PID: 28918 (upsd)<br>
>> Tasks: 1 (limit: 9482)<br>
>> Memory: 736.0K<br>
>> CPU: 20ms<br>
>> CGroup: /system.slice/nut-server.service<br>
>> └─28918 /usr/sbin/upsd -F<br>
>><br>
>> Nov 30 19:06:53 mythtv.billgee.local nut-server[28918]: /var/run is <br>
>> world readable<br>
>> Nov 30 19:06:53 mythtv.billgee.local upsd[28918]: /var/run is world <br>
>> readable<br>
>> Nov 30 19:06:53 mythtv.billgee.local upsd[28918]: Can't connect to UPS <br>
>> [cyberpower] (usbhid-ups-cyberpower): Connection refused<br>
>> Nov 30 19:06:53 mythtv.billgee.local nut-server[28918]: Can't connect <br>
>> to UPS [cyberpower] (usbhid-ups-cyberpower): Connection refused<br>
>> Nov 30 19:06:53 mythtv.billgee.local nut-server[28918]: Running as <br>
>> foreground process, not saving a PID file<br>
>> Nov 30 19:06:53 mythtv.billgee.local upsd[28918]: Running as <br>
>> foreground process, not saving a PID file<br>
>> Nov 30 19:11:53 mythtv.billgee.local nut-server[28918]: Can't connect <br>
>> to UPS [cyberpower] (usbhid-ups-cyberpower): Connection refused<br>
>> Nov 30 19:11:53 mythtv.billgee.local upsd[28918]: Can't connect to UPS <br>
>> [cyberpower] (usbhid-ups-cyberpower): Connection refused<br>
>> Nov 30 19:16:53 mythtv.billgee.local nut-server[28918]: Can't connect <br>
>> to UPS [cyberpower] (usbhid-ups-cyberpower): Connection refused<br>
>> Nov 30 19:16:53 mythtv.billgee.local upsd[28918]: Can't connect to UPS <br>
>> [cyberpower] (usbhid-ups-cyberpower): Connection refused<br>
>><br>
>> [root@mythtv ups]# ps ax | grep ups<br>
>> 768 ? Ss 0:00 /usr/sbin/cupsd -l<br>
>> 773 ? Ss 0:00 sshd: /usr/sbin/sshd -D [listener] 0 of <br>
>> 10-100 startups<br>
>> 28769 ? Ss 0:00 /usr/sbin/usbhid-ups -a cyberpower<br>
>> 28918 ? Ss 0:00 /usr/sbin/upsd -F<br>
>> 28929 pts/1 S+ 0:00 grep --color=auto ups<br>
>><br>
>> [root@mythtv ups]# upsc cyberpower@localhost<br>
>> Error: Driver not connected<br>
> <br>
> upsc won't work without nut-server running, so this is expected based on <br>
> the above failure to start nut-server.<br>
> <br>
>><br>
>><br>
> <br>
> So... next.<br>
> <br>
> Fix nut-client.conf contents, and make sure that you can start / restart <br>
> the driver as needed with no errors. Set nut-driver@cyberpower.service <br>
> to enabled for autostart, so with ONLY the enumerator services and <br>
> nut-driver@cyberpower.service enabled, you should see something like the <br>
> following for 'systemctl list-unit-files | grep -i nut':<br>
> <br>
> [root@emp80 ups]# systemctl list-unit-files | grep -i nut<br>
> nut-driver-enumerator.path <br>
> enabled<br>
> nut-driver-enumerator.service <br>
> enabled<br>
> nut-driver@.service <br>
> indirect<br>
> nut-monitor.service <br>
> disabled<br>
> nut-server.service <br>
> disabled<br>
> nut-driver.target <br>
> disabled<br>
> nut.target <br>
> disabled<br>
> <br>
> Stop any running nut processes, and reboot. On reboot the only thing <br>
> that should autostart is nut-driver@cyberpower.service (from the <br>
> 'indirect' call via nut-driver@.service). upsc will still not work.<br>
> <br>
> Monitor the driver for a while 'journalctl -u <br>
> nut-driver@cyberpower.service -f' and make sure it is stable and stays <br>
> connected - google searches show some flakiness with some cyberpower UPSs.<br>
> <br>
> Once you are confident that the driver is reliable, starting OK and <br>
> staying up then move on to nut-server.<br>
> <br>
> I'll check in this evening and we can do some more digging on that.<br>
> <br>
> Simon<br>
> <br>
>><br>
>> ===============<br>
>> Bill Gee<br>
>><br>
>> On 11/30/22 07:21, Simon Wilson via Nut-upsuser wrote:<br>
>>> Comments inline.<br>
>>><br>
>>> ----- Message from Bill Gee <<a href="mailto:bgee@campercaver.net" target="_blank">bgee@campercaver.net</a>> ---------<br>
>>> Date: Wed, 30 Nov 2022 06:04:14 -0600<br>
>>> From: Bill Gee <<a href="mailto:bgee@campercaver.net" target="_blank">bgee@campercaver.net</a>><br>
>>> Subject: Re: [Nut-upsuser] NUT no longer works after 2.7 -> 2.8 upgrade<br>
>>> To: <a href="mailto:nut-upsuser@alioth-lists.debian.net" target="_blank">nut-upsuser@alioth-lists.debian.net</a><br>
>>><br>
>>><br>
>>>> Hi Simon --<br>
>>>><br>
>>>> Yes, I am pretty sure this is the RedHat packaging problem. I sure <br>
>>>> hope they get it squared away. I have only one system using nut and <br>
>>>> that is because all my other systems have APC battery backup and run <br>
>>>> apcupsd. Apcupsd may be old, grey and unmaintained, but it Just Works.<br>
>>>><br>
>>>> You mention that the STATEPATH line in upsd.conf will override other <br>
>>>> settings. It does not appear to be the case for me. The only way I <br>
>>>> could get the driver to run was by setting NUT_STATEPATH on the <br>
>>>> command line. Perhaps that is an issue with the driver and not <br>
>>>> nut-server?<br>
>>>><br>
>>>> In answer to your questions:<br>
>>>><br>
>>>> 1) /usr/lib/systemd/system/nut-driver@.service exists. I have made <br>
>>>> no changes to it so far. Here are the contents, unfortunately <br>
>>>> line-wrapped by Thunderbird.<br>
>>>><br>
>>>> ================================<br>
>>>> [root@mythtv system]# grep -v '^#' nut-driver@.service<br>
>>>> [Unit]<br>
>>>> Description=Network UPS Tools - device driver for %I<br>
>>>> After=local-fs.target<br>
>>>><br>
>>>><br>
>>>> PartOf=nut-driver.target<br>
>>>><br>
>>>><br>
>>>> [Service]<br>
>>>> EnvironmentFile=-/etc/ups/nut.conf<br>
>>>> SyslogIdentifier=%N<br>
>>>> ExecStartPre=-/usr/bin/systemd-tmpfiles --create <br>
>>>> /usr/lib/tmpfiles.d/nut-client.conf<br>
>>>> ExecStart=/bin/sh -c 'NUTDEV="`/usr/libexec/nut-driver-enumerator.sh <br>
>>>> --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: <br>
>>>> Could not find a NUT device section for service unit %i" >&2 ; exit <br>
>>>> 1 ; } ; /usr/sbin/upsdrvctl start "$NUTDEV"'<br>
>>>> ExecStop=/bin/sh -c 'NUTDEV="`/usr/libexec/nut-driver-enumerator.sh <br>
>>>> --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: <br>
>>>> Could not find a NUT device section for service unit %i" >&2 ; exit <br>
>>>> 1 ; } ; /usr/sbin/upsdrvctl stop "$NUTDEV"'<br>
>>>> StartLimitInterval=0<br>
>>>> Restart=always<br>
>>>> RestartSec=15s<br>
>>>> Type=forking<br>
>>>><br>
>>>> [Install]<br>
>>>> WantedBy=nut-driver.target<br>
>>>> ===================================<br>
>>><br>
>>> OK, so that's the same as mine. It's ExecStartPre task is to create <br>
>>> the pid folder from your answer to the third (unasked) question :) <br>
>>> which is that outlined in /usr/lib/tmpfiles.d/nut-client.conf<br>
>>><br>
>>> You have /var/run/nut 0770 root nut - so systemd should ensure that <br>
>>> exists.<br>
>>><br>
>>> By the way, having it with "/var/run/nut" will trigger a 'noise' <br>
>>> error about the "/var" path - change it to just be /run/nut in <br>
>>> nut-client.conf.<br>
>>><br>
>>> As a test, what happens if you:<br>
>>><br>
>>> - make sure nut.conf has MODE=standalone<br>
>>> - make sure ALL nut services are stopped, i.e. 'ps -ax | grep ups' <br>
>>> should give you only the grep process as an answer<br>
>>> - delete /run/nut folder (it will get re-created automatically)<br>
>>> - take /etc/ups/upsd.conf back to have commented out STATEPATH as <br>
>>> distributed in the package<br>
>>> - run "systemctl enable nut-driver-enumerator.path <br>
>>> nut-driver-enumerator.service --now" - this will enable and start the <br>
>>> services that monitor ups.conf for changes and then write the actual <br>
>>> driver service file; the second one also runs early in boot and <br>
>>> ensures that the service file exists and is correct.<br>
>>> - run 'nut-scanner -U' and copy its output into ups.conf instead of <br>
>>> your current definition with name heading [cyberpower], save and <br>
>>> exit: this will trigger the above enumerators to run and re-do the <br>
>>> nut-driver@cyberpower.service file<br>
>>><br>
>>> Based on an out of the box install, you have at this point done <br>
>>> enough that the driver should run (*should*!!!!)<br>
>>><br>
>>> - run "journalctl -u nut-driver@cyberpower.service -f" in one <br>
>>> terminal while you run "systemctl start <br>
>>> nut-driver@cyberpower.service" in another - what does journalctl output?<br>
>>><br>
>>> Assuming it does not start (based on what you have said below), show <br>
>>> the messages.<br>
>>><br>
>>> If it still does not start as configured above, but you \can/ run <br>
>>> /usr/sbin/usbhid-ups with your environment variables specified like <br>
>>> you had done before, and it *does* run, then do the following steps <br>
>>> to create a systemd drop-in file for the variable, but make the steps <br>
>>> use /run/nut instead of /var/run/nut: <br>
>>> <a href="https://bugzilla.redhat.com/show_bug.cgi?id=2127269#c8" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=2127269#c8</a> (comment 8, <br>
>>> formatted for ease of reading). You want to get back to the RH/Fedora <br>
>>> default of using /run/nut, not /var/state/ups<br>
>>><br>
>>> 1. uncomment the "STATEPATH /var/run/nut" as already mentioned<br>
>>> 2. create: /etc/systemd/system/nut-driver@.service.d/environ.conf<br>
>>> with these two lines:<br>
>>><br>
>>> [Service]<br>
>>> Environment=NUT_STATEPATH=/var/run/nut<br>
>>><br>
>>> 3. and finally do: systemctl daemon-reload<br>
>>><br>
>>> ...then try and run systemctl start nut-driver@cyberpower.service <br>
>>> again, while monitoring journalctl.<br>
>>><br>
>>><br>
>>> If that does not work - then I'm out of ideas at this point lol... :-D<br>
>>><br>
>>> 'set' has nothing BTW on my working system related to nut.<br>
>>><br>
>>>><br>
>>>> 2) In /etc/ups/upsd.conf, the original STATEPATH line is<br>
>>>><br>
>>>> STATEPATH /var/run/nut<br>
>>>><br>
>>>> Right now the original line is commented and I added another line to <br>
>>>> point at /var/state/ups.<br>
>>>><br>
>>>> 3) You only asked two questions, but I sense a third might be <br>
>>>> important. Originally the system had <br>
>>>> /usr/lib/tmpfiles.d/nut-common.conf. I have modified that file and <br>
>>>> no longer have the original. I copied that file to nut-client.conf, <br>
>>>> and both have the same contents:<br>
>>>><br>
>>>> =======================<br>
>>>> # State file (e.g. upsd to driver) and pidfile location for NUT:<br>
>>>> D /var/run/nut 0770 root nut - -<br>
>>>> X /var/run/nut<br>
>>>> ========================<br>
>>>><br>
>>>> 4) And one more unasked question! :-) When I look at the <br>
>>>> environment variables on the system, I see this:<br>
>>>><br>
>>>> ========================<br>
>>>> [root@mythtv tmpfiles.d]# set | grep -i nut<br>
>>>> _=/etc/ups/nut.conf<br>
>>>> ========================<br>
>>>><br>
>>>><br>
>>>><br>
>>>> Bill Gee<br>
>>>><br>
>>>> On 11/30/22 01:20, Simon Wilson via Nut-upsuser wrote:<br>
>>>>> ----- Message from Bill Gee <<a href="mailto:bgee@campercaver.net" target="_blank">bgee@campercaver.net</a>> ---------<br>
>>>>> Date: Tue, 29 Nov 2022 19:25:19 -0600<br>
>>>>> From: Bill Gee <<a href="mailto:bgee@campercaver.net" target="_blank">bgee@campercaver.net</a>><br>
>>>>> Subject: Re: [Nut-upsuser] NUT no longer works after 2.7 -> 2.8 <br>
>>>>> upgrade<br>
>>>>> To: Jim Klimov <<a href="mailto:jimklimov%2Bnut@gmail.com" target="_blank">jimklimov+nut@gmail.com</a>><br>
>>>>> Cc: Arnaud Quette via Nut-upsuser <br>
>>>>> <<a href="mailto:nut-upsuser@alioth-lists.debian.net" target="_blank">nut-upsuser@alioth-lists.debian.net</a>><br>
>>>>><br>
>>>>><br>
>>>>>> I got it to run, but what a mess ...<br>
>>>>>><br>
>>>>>> Yes, I am running systemctl daemon-reload and systemctl restart <br>
>>>>>> nut-server after each change I make.<br>
>>>>>><br>
>>>>><br>
>>>>> Hi Bill,<br>
>>>>><br>
>>>>> Drivers and upsd share defaults (see 'man nutupsdrv').<br>
>>>>><br>
>>>>> Your original error message ("writepid: fopen <br>
>>>>> /var/run/usbhid-ups-cyberpower.pid: Permission denied") would seem <br>
>>>>> to indicate, same as the Red Hat bug, that your driver's default <br>
>>>>> pid path is /var/run.<br>
>>>>><br>
>>>>> The driver by default uses STATEPATH (which can be over-ridden in <br>
>>>>> upsd.conf) to store pid files. The driver .service file is supposed <br>
>>>>> to make sure that path exists by running the ExecStartPre line, <br>
>>>>> which gets its instructions from the referenced ".conf" file from <br>
>>>>> /usr/lib/tmpfiles.d. The .service file then calls 'upsdrvctl start' <br>
>>>>> to start your usbhid-ups driver, as defined in ups.conf. Those all <br>
>>>>> need to align...<br>
>>>>><br>
>>>>> 2 x questions:<br>
>>>>><br>
>>>>> 1. Without its comments, what are the active lines (as installed, <br>
>>>>> without any changes) in /usr/lib/systemd/system/nut-driver@.service <br>
>>>>> (or wherever that service file is located on your system)?<br>
>>>>> 2. in your upsd.conf (also as installed, without any changes), what <br>
>>>>> is the commented out STATEPATH you later mention uncommenting?<br>
>>>>><br>
>>>>>> I created /usr/lib/tmpfiles.d/nut-client.conf The owner is <br>
>>>>>> root:root and permissions are 0644. The contents are<br>
>>>>>><br>
>>>>>> # State file (e.g. upsd to driver) and pidfile location for NUT:<br>
>>>>>> D /var/run/nut 0770 root nut - -<br>
>>>>>> X /var/run/nut<br>
>>>>>><br>
>>>>>> I uncommented the STATEPATH line in /etc/ups/upsd.conf.<br>
>>>>>><br>
>>>>>> I created a directory /var/state/ups, set to 777 permissions. <br>
>>>>>> Changed the STATEPATH line in upsd.conf. No success.<br>
>>>>>><br>
>>>>>> I looked at /usr/lib/systemd/system/nut-driver@.service but could <br>
>>>>>> not see any changes to be made. The bug report at RedHat mentions <br>
>>>>>> that a file identified in ExecStartPre does not exist, but I could <br>
>>>>>> not duplicate.<br>
>>>>>><br>
>>>>>> I tried running this as root:<br>
>>>>>><br>
>>>>>> NUT_STATEPATH=/var/state/ups NUT_ALTPIDPATH=/var/state/ups <br>
>>>>>> /usr/sbin/usbhid-ups -u nut -g nut -s cyberpower -x port=auto<br>
>>>>>><br>
>>>>>> And it works. I tried it with only one or the other of the two <br>
>>>>>> environment variables, but did not work. It has to have both.<br>
>>>>>><br>
>>>>>> ===============<br>
>>>>>> Bill Gee<br>
>>>>>><br>
>>>><br>
>>>> _______________________________________________<br>
>>>> Nut-upsuser mailing list<br>
>>>> <a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a><br>
>>>> <a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
>>><br>
>>><br>
>>> ----- End message from Bill Gee <<a href="mailto:bgee@campercaver.net" target="_blank">bgee@campercaver.net</a>> -----<br>
>>><br>
>>><br>
>>><br>
>><br>
>> _______________________________________________<br>
>> Nut-upsuser mailing list<br>
>> <a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a><br>
>> <a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
> <br>
> <br>
> ----- End message from Bill Gee <<a href="mailto:bgee@campercaver.net" target="_blank">bgee@campercaver.net</a>> -----<br>
> <br>
> <br>
> <br>
<br>
_______________________________________________<br>
Nut-upsuser mailing list<br>
<a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a><br>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
</blockquote></div>