<div dir="ltr"><div>With recent NUT releases, driver disconnections should be contained in its own `nut-driver@eaton` instance (the `@upsname` part is derived from the `ups.conf` section name). One of the drivers failing and restarting is not a proper cause for the data server to recycle. </div><div><br></div><div>Also, nowadays some (maybe not all) USB-capable drivers should try to reconnect without restarting. Note however, that in some NUT iterations it is possible that this feature misfires if the devices get re-enumerated and the driver tries to reuse results of original libusb discovery (e.g. some kernels add +1 to "device" number upon each reconnection, such as due to USB chip/hub reset, EMI causing protocol reset, or a device going to sleep and yanked back to work).<br></div><div><br></div><div>In fact, recent work on master branch got `nut-scanner` to not suggest the `device` option by default to avoid such situations.<br></div><div><br></div><div>Jim</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 19, 2024 at 9:36 AM Matus UHLAR - fantomas <<a href="mailto:uhlar@fantomas.sk">uhlar@fantomas.sk</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">On 19.01.24 09:00, Jim Klimov via Nut-upsuser wrote:<br>
>Well, from your logs it seems that at 05:17:03 your nut-server (upsd)<br>
>restarted, so an upsmon reconnection attempt at 05:17:09 had an issue with<br>
>that (config not all applied? strange a bit) but since 05:17:14 it is okay.<br>
><br>
>Maybe a few too many banners shown from upsmon, while its same uptime seems<br>
>to continue. Maybe someone should check on that, seems like a good and easy<br>
>newcomer issue to learn the code, so PRs are welcome :D<br>
><br>
>Messages about lack of "*.pid" files are okay, they should look less scary<br>
>in newer releases of NUT. They confirm that there is no previous daemon<br>
>with the same basic configuration currently running, so that your new<br>
>instance might conflict with it or send it some signals intentionally - so<br>
>it is just a new start in a clean environment with no competitors.<br>
><br>
>It is a bit unfortunate that both syslog (upsd) and stderr (nut-server)<br>
>messages land into the same systemd journal. It may be possible to add<br>
>auto-detection of systemd and not-emit one of those streams then, or add an<br>
>option for that to be quieter and better readable (some people can have a<br>
>separate syslog setup anyway, maybe on a remote "sink" system, so just<br>
>cutting one off always is not right).<br>
><br>
>So one question that remains is the missing lines from previous lifetime in<br>
>the short excerpt of upsd: why did it restart at that time? :)<br>
<br>
I also have Eaton UPS, just different model. It sometimes disconnects and <br>
nut has to connect again. I guess this is what happened.<br>
<br>
I assume the disonnect message is not visible in "Systemctl status" message <br>
because it does not belong to the current process but previous one.<br>
Looking for syslog (/var/log/messages) or journal messages (journalctl) could <br>
show that. I guess nothing bad happened there.<br>
<br>
>On Fri, Jan 19, 2024 at 6:13 AM Stefan Schumacher via Nut-upsuser <<br>
><a href="mailto:nut-upsuser@alioth-lists.debian.net" target="_blank">nut-upsuser@alioth-lists.debian.net</a>> wrote:<br>
>> I recently bought a small UPS by Eaton (Ellipse ECO 800) in order to<br>
>> prevent my<br>
>> btrfs-fileserver (running Debian 12 Bookworm 12.4 from shutting down<br>
>> abruptly while writing<br>
>> something important during a power loss. I am using the version<br>
>> 2.8.0.7 provided by Debian.<br>
>> I have found very gooddocumentation on how to set up the UPS and the<br>
>> services on the server<br>
>> connected to it. Unfortunately it's in German<br>
>> (<a href="https://techbotch.org/blog/ups-setup/index.html" rel="noreferrer" target="_blank">https://techbotch.org/blog/ups-setup/index.html</a>) which is not a<br>
>> problem for me but possibly for others trying to understand my set-up.<br>
>><br>
>> I will now describe the steps I took and the configuration options I<br>
>> set and then post the errors of nut-monitor and nut server. I hope<br>
>> someone can help fix the underlying problem behind these error<br>
>> messages.<br>
>><br>
>> lsusb shows the UPS:<br>
>> Bus 001 Device 003: ID 0463:ffff MGE UPS Systems UPS<br>
>><br>
>> So I made this changes to ups.conf<br>
>> [Eaton]<br>
>> driver = usbhid-ups<br>
>> port = auto<br>
>> vendorid = 0463<br>
>> pollfreq = 30<br>
>><br>
>> In nut.conf I set mode=standalone.<br>
>><br>
>> And finally I added these lines to upsd.users:<br>
>> [upsmon]<br>
>> password = XXXX<br>
>> actions = SET<br>
>> instcmds = ALL<br>
>><br>
>> I did a live test, plugged the cord and waited until the server shut<br>
>> down at 20%. Worked fine.<br>
>> Upsc also works - I can query my UPS for specific parameters or show them<br>
>> all.<br>
>><br>
>> The problem is the dozens of errors the systemctl status messages<br>
>> show. I bought the UPS to increase reliability and now I don't know if<br>
>> the service is working in case of an emergency. How can I fix this ?<br>
>><br>
>> ● nut-server.service - Network UPS Tools - power devices information server<br>
>> Loaded: loaded (/lib/systemd/system/nut-server.service; enabled;<br>
>> preset: enabled)<br>
>> Active: active (running) since Fri 2024-01-19 05:17:03 CET; 5s ago<br>
>> Main PID: 1303 (upsd)<br>
>> Tasks: 1 (limit: 38253)<br>
>> Memory: 640.0K<br>
>> CPU: 3ms<br>
>> CGroup: /system.slice/nut-server.service<br>
>> └─1303 /lib/nut/upsd -F<br>
>> Jan 19 05:17:03 servername nut-server[1303]: fopen /run/nut/upsd.pid:<br>
>> No such file or directory<br>
>> Jan 19 05:17:03 servername nut-server[1303]: Could not find PID file<br>
>> '/run/nut/upsd.pid' to see if previous upsd instance is already<br>
>> running!<br>
>> Jan 19 05:17:03 servername nut-server[1303]: listening on 127.0.0.1 port<br>
>> 3493<br>
>> Jan 19 05:17:03 servername nut-server[1303]: listening on ::1 port 3493<br>
>> Jan 19 05:17:03 servername upsd[1303]: listening on 127.0.0.1 port 3493<br>
>> Jan 19 05:17:03 servername upsd[1303]: listening on ::1 port 3493<br>
>> Jan 19 05:17:03 servername nut-server[1303]: Connected to UPS [Eaton]:<br>
>> usbhid-ups-Eaton<br>
>> Jan 19 05:17:03 servername upsd[1303]: Connected to UPS [Eaton]:<br>
>> usbhid-ups-Eaton<br>
>> Jan 19 05:17:03 servername upsd[1303]: Running as foreground process,<br>
>> not saving a PID file<br>
>> Jan 19 05:17:03 servername nut-server[1303]: Running as foreground<br>
>> process, not saving a PID file<br>
>><br>
>> ● nut-monitor.service - Network UPS Tools - power device monitor and<br>
>> shutdown controller<br>
>> Loaded: loaded (/lib/systemd/system/nut-monitor.service; enabled;<br>
>> preset: enabled)<br>
>> Active: active (running) since Fri 2024-01-19 03:37:28 CET; 1h 41min ago<br>
>> Main PID: 847 (upsmon)<br>
>> Tasks: 2 (limit: 38253)<br>
>> Memory: 3.4M<br>
>> CPU: 338ms<br>
>> CGroup: /system.slice/nut-monitor.service<br>
>> ├─847 /lib/nut/upsmon -F<br>
>> └─849 /lib/nut/upsmon -F<br>
>> Jan 19 03:43:08 servername nut-monitor[849]: UPS Eaton@localhost on<br>
>> battery<br>
>> Jan 19 03:43:09 servername nut-monitor[916]: Network UPS Tools upsmon 2.8.0<br>
>> Jan 19 03:43:33 servername nut-monitor[849]: UPS Eaton@localhost on line<br>
>> power<br>
>> Jan 19 03:43:34 servername nut-monitor[920]: Network UPS Tools upsmon 2.8.0<br>
>> Jan 19 05:17:04 servername nut-monitor[849]: Poll UPS<br>
>> [Eaton@localhost] failed - Write error: Broken pipe<br>
>> Jan 19 05:17:04 servername nut-monitor[849]: Communications with UPS<br>
>> Eaton@localhost lost<br>
>> Jan 19 05:17:04 servername nut-monitor[1305]: Network UPS Tools upsmon<br>
>> 2.8.0<br>
>> Jan 19 05:17:09 servername nut-monitor[849]: Login on UPS<br>
>> [Eaton@localhost] failed - got [ERR ACCESS-DENIED]<br>
>> Jan 19 05:17:14 servername nut-monitor[849]: Communications with UPS<br>
>> Eaton@localhost established<br>
>> Jan 19 05:17:14 servername nut-monitor[1312]: Network UPS Tools upsmon<br>
>> 2.8.0<br>
<br>
<br>
-- <br>
Matus UHLAR - fantomas, <a href="mailto:uhlar@fantomas.sk" target="_blank">uhlar@fantomas.sk</a> ; <a href="http://www.fantomas.sk/" rel="noreferrer" target="_blank">http://www.fantomas.sk/</a><br>
Warning: I wish NOT to receive e-mail advertising to this address.<br>
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.<br>
Spam = (S)tupid (P)eople's (A)dvertising (M)ethod<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>