[Bug]: NetworkManager-wait-online.service not enabled when NM used - means services that require working network start prematurely and fail
Description
Checklist
hideActivity
Show:
Details
Details
Assignee
Unassigned
UnassignedReporter

Priority
Created February 28, 2025 at 9:25 PM
Updated February 28, 2025 at 9:25 PM
What happened?
I have observed this issue running Armbian v25.2.1 for Tinker Board running Armbian Linux 6.12.16-current-rockchip (Ubuntu noble server image).
This image uses NetworkManager for network config. When NM is used the NetworkManager-wait-online.service must be enabled so that network-online.target is not reached until NetworkManager has brought up all the interfaces. Service units that require the network to be up before starting rely on network-online.target working correctly otherwise they will likely fail on boot (which is the problem I observed).
See [the systemd documentation](https://systemd.io/NETWORK_ONLINE/), in particular the first two FAQs.
I encountered this problem when trying to set up a dhcp server, using the isc-dhcpd-server package. I correctly configured the dhcp server, enabled its unit and restarted it. It worked. However when I rebooted the Pi the dhcp server failed to start claiming "there was no subnet definition for end0". I figured out that this was because at the time isc-dhcp-server was starting the network had not yet come up, so dhcpd could not obtain the IP address & netmask for the interface to match with the subnet definition in the config file.
Reading the systemd documentation (linked above) I ran the suggested command to see if the wait services were enabled:
```
$ systemctl is-enabled NetworkManager-wait-online.service systemd-networkd-wait-online.service
disabled
disabled
```
This reveals that NetworkManager-wait-online.service is disabled, when it should be enabled when NM is used to configure the network.
I enabled NetworkManager-wait-online.service and then rebooted. The dhcp server started correctly.
How to reproduce?
In a running Armbian system execute the following command (from the systemd documentation) and verify that the correct wait unit (depending on how network configuration is done in the image) is enabled:
```
$ systemctl is-enabled NetworkManager-wait-online.service systemd-networkd-wait-online.service
disabled
enabled
```
Branch
main (main development branch)
On which host OS are you running the build script and observing this problem?
Other
Are you building on Windows WSL2?
[ ] Yes, my Ubuntu/Debian/OtherOS is running on WSL2
Relevant log URL
No response
Code of Conduct
[x] I agree to follow this project's Code of Conduct
Raised by: https://github.com/daniel-ayers
https://github.com/armbian/build/issues/7896