<div dir="ltr"><div>For general troubleshooting, take a look at `journalctl -xln` (started as `root`) to see details of systemd unit state transitions. It is as close as I could get to guessing (still) why the framework decides to do some things it does.</div><div><br></div><div>I wonder if the packaging misses (or did not activate) a dependency definition to start NUT in the first place. Vanilla code includes several `*.target` unit files, namely `nut.target` as the umbrella which `Wants=local-fs.target nut-driver.target nut-server.service nut-monitor.service` and is `WantedBy=multi-user.target`, and `nut-driver.target` which `nut-driver@*.service` instances managed by NDE <a href="https://github.com/networkupstools/nut/wiki/nut%E2%80%90driver%E2%80%90enumerator-(NDE)">https://github.com/networkupstools/nut/wiki/nut%E2%80%90driver%E2%80%90enumerator-(NDE)</a> can claim to be `WantedBy`.</div><div><br></div><div>The expected state is, following clues from <a href="https://github.com/networkupstools/nut/wiki/Building-NUT-for-in%E2%80%90place-upgrades-or-non%E2%80%90disruptive-tests#replacing-a-systemd-deployment">https://github.com/networkupstools/nut/wiki/Building-NUT-for-in%E2%80%90place-upgrades-or-non%E2%80%90disruptive-tests#replacing-a-systemd-deployment</a> that the modern-Linux-distro packaging would deliver the unit files, run `<code>systemctl daemon-reload</code>`, maybe explicitly run `<code>systemd-tmpfiles --create</code>` (otherwiseOS boot or start-up of service units should take care of this), and `<code>systemctl disable</code>` +
`<code>systemctl enable</code>` the delivered units, making them known and registering them with systemd dependency tree (notably the
`WantedBy=multi-user.target`part of the `nut.target`
umbrella
unit). They may use or not a <a href="https://www.freedesktop.org/software/systemd/man/latest/systemd.preset.html">https://www.freedesktop.org/software/systemd/man/latest/systemd.preset.html</a> file for this (currently vanilla NUT sources do not ship one).<br></div><div><br></div><div>Also note that individual units (services, targets, ...) may be explicitly `disable`'d or even `mask`'ed as you manage your system, so that may also come into play.</div><div><br></div><div>Hope this helps,</div><div>Jim Klimov</div><div><br></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 28, 2024 at 12:54 AM Rick Dicaire via Nut-upsuser <<a href="mailto:nut-upsuser@alioth-lists.debian.net">nut-upsuser@alioth-lists.debian.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"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi folks, I'm having an issue with getting nut-server to start at boot on a freshly installed Fedora 40 desktop. Seems once the machine is up, I can manually start with systemctl start nut-server and everythings fine.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">dnf info nut<br>Last metadata expiration check: 2:08:11 ago on Sat 27 Jul 2024 03:48:13 PM EDT.<br>Installed Packages<br>Name : nut<br>Version : 2.8.2<br>Release : 1.fc40<br>Architecture : x86_64<br>Size : 12 M<br>Source : nut-2.8.2-1.fc40.src.rpm<br>Repository : @System<br>From repo : updates<br>Summary : Network UPS Tools<br>URL : <a href="https://www.networkupstools.org/" target="_blank">https://www.networkupstools.org/</a><br>License : GPL-2.0-or-later AND GPL-3.0-or-later<br>Description : These programs are part of a developing project to monitor the assortment<br> : of UPSes that are found out there in the field. Many models have serial<br> : ports of some kind that allow some form of state checking. This<br> : capability has been harnessed where possible to allow for safe shutdowns,<br> : live status tracking on web pages, and more.<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I've tried with specific LISTEN lines in upsd.conf, also tried without one specified. Same result, service doesn't start at boot. No apparent errors reported either:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">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; enabled; preset: disabled)<br> Drop-In: /usr/lib/systemd/system/service.d<br> └─10-timeout-abort.conf<br> Active: inactive (dead)<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">In /usr/lib/systemd/system/nut-server.service there's mention of:<br><br># The `upsd` is a networked service (even if bound to a `localhost`)<br># so it requires that the OS has some notion of networking already.<br># Extending the unit does not require *this* file to be edited, you<br># can instead drop in an additional piece of configuration, e.g. to<br># require that NUT data server only starts after external networking<br># is configured (usable IP addresses appear in the system) you can<br># add a `/etc/systemd/system/nut-server.service.d/network.conf` with:<br># [Unit]<br># Requires=network-online.target<br># After=network-online.target<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">However adding this file with those three lines (uncommented yes) still results in no nut-server running, with and without LISTEN lines in upsd.conf.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Since there's no issues starting the service manually after reboot, I feel like this is some kind of systemd thing as opposed to a nut config issue.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Various config file contents:<br><br>nut.conf<br>MODE=netserver</div><div class="gmail_default" style="font-size:small"><br>ups.conf<br>maxretry = 3<br>[cp1500]<br> driver = usbhid-ups<br> port = auto<br> vendorid = 0764<br> pollinterval = 5<br> desc = "toshiba: TV, roku, switch"<br><br></div><div class="gmail_default" style="font-size:small">upsd.conf<br>LISTEN 0.0.0.0 3493</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">upsmon.conf<br>MONITOR cp1500@localhost 1 monuser monuserpass primary<br>MINSUPPLIES 1<br>SHUTDOWNCMD "/sbin/shutdown -h +0"<br>POLLFREQ 5<br>POLLFREQALERT 5<br>HOSTSYNC 15<br>DEADTIME 15<br>POWERDOWNFLAG "/etc/killpower"<br> NOTIFYMSG ONLINE "UPS %s on line power"<br> NOTIFYMSG ONBATT "UPS %s on battery"<br> NOTIFYMSG LOWBATT "UPS %s battery is low"<br> NOTIFYMSG FSD "UPS %s: forced shutdown in progress"<br> NOTIFYMSG COMMOK "Communications with UPS %s established"<br> NOTIFYMSG COMMBAD "Communications with UPS %s lost"<br> NOTIFYMSG SHUTDOWN "Auto logout and shutdown proceeding"<br> NOTIFYMSG REPLBATT "UPS %s battery needs to be replaced"<br> NOTIFYMSG NOCOMM "UPS %s is unavailable"<br> NOTIFYMSG NOPARENT "upsmon parent process died - shutdown impossible"<br> NOTIFYFLAG ONLINE SYSLOG+WALL<br> NOTIFYFLAG ONBATT SYSLOG+WALL<br> NOTIFYFLAG LOWBATT SYSLOG+WALL<br> NOTIFYFLAG FSD SYSLOG+WALL<br> NOTIFYFLAG COMMOK SYSLOG+WALL<br> NOTIFYFLAG COMMBAD SYSLOG+WALL<br> NOTIFYFLAG SHUTDOWN SYSLOG+WALL<br> NOTIFYFLAG REPLBATT SYSLOG+WALL<br> NOTIFYFLAG NOCOMM SYSLOG+WALL<br> NOTIFYFLAG NOPARENT SYSLOG+WALL<br>OFFDURATION 30<br>RBWARNTIME 43200<br>NOCOMMWARNTIME 300<br>FINALDELAY 5<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Ultimately I need this service to listen on lan interface as I query it from other lan machine.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Can anyone provide any insight on my issue?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks</div></div>
_______________________________________________<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>