Bug 1867067
Summary: | nut-server can fail to start on boot (starts before network is up) | ||
---|---|---|---|
Product: | [Fedora] Fedora EPEL | Reporter: | Tim Jackson <rpm> |
Component: | nut | Assignee: | Michal Hlavinka <mhlavink> |
Status: | NEW --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | epel8 | CC: | alexducast, brainslug, dkaylor, dr, james, kritek, mhlavink, orion |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | Type: | Bug | |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Tim Jackson
2020-08-07 10:06:17 UTC
I realised that the unit file already has "After=network.target", so that alone doesn't solve the problem. However, I have more information about this: - It's apparently triggered by the configuration of an IP address other than 127.0.0.1 ("LISTEN x.y.z.a" configuration option in upsd.conf) and occurs when the x.y.z.a interface is not ready at the time upsd starts up - The solution is to change "After=network.target" to "After=network-online.target" in nut-server.service => According to https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ , this is less desirable than "After=network.target", but as I understand it from that article, the primary solution to avoid it for a server that can be configured to listen on an arbitrary address seems to be for the server to use the IP_FREEBIND socket option (which upsd apparently does not, at least by grepping the code). So, unless and until upsd upstream changes this, waiting for "network-online.target" seems to be the best option. - Along the way I found that, *if* listening on all interfaces is an acceptable solution, "LISTEN 0.0.0.0" works, and does not suffer from this issue. => Workaround for some use cases I ran into exactly the same issue today and was about to file a bug report when I found this one. Thanks to OP for saving me some time writing it up, I hope this will be fixed soon. Same here - same problem, and came to the same conclusion of changing the After to "network-online.target" as the least offending solution. Still an issue with Fedora 40. Including trying this from /usr/lib/systemd/system/nut-server.service: # The `upsd` is a networked service (even if bound to a `localhost`) # so it requires that the OS has some notion of networking already. # Extending the unit does not require *this* file to be edited, you # can instead drop in an additional piece of configuration, e.g. to # require that NUT data server only starts after external networking # is configured (usable IP addresses appear in the system) you can # add a `/etc/systemd/system/nut-server.service.d/network.conf` with: # [Unit] # Requires=network-online.target # After=network-online.target I should also mention my LISTEN line in /etc/ups/upsd.conf is: LISTEN 0.0.0.0 3493 UPDATE: With help from Nut Mailing List, these are the steps I used to get nut working: 1. Configure the various files in /etc/ups 2. Edit /usr/lib/systemd/system/nut.target and add: network.target network-online.target to Wants and After lines. 3. Run systemctl daemon-reload. 4. Run systemctl enable nut.target. 5. Run systemctl start nut-driver-enumerator. 6. Reboot. Check that upsmon is talking to upsd. Check from remote host that upsc ups_name@host works. |