Enable wait-online.service in firstlogin config

Reasoning: https://github.com/armbian/build/issues/7896
This commit is contained in:
Igor Pecovnik
2025-03-06 15:10:13 +01:00
committed by Igor
parent c0efeb3674
commit 7f32a58535

View File

@@ -706,6 +706,21 @@ if [[ -f /root/.not_logged_in_yet && -n $(tty) ]]; then
fi
fi
# enable networkManager-wait-online.service
# 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
# Same goes for systemd-networkd stack
# https://github.com/armbian/build/issues/7896
if systemctl is-active --quiet NetworkManager; then
systemctl enable NetworkManager-wait-online.service
systemctl start NetworkManager-wait-online.service
fi
if systemctl is-active --quiet systemd-networkd; then
systemctl enable systemd-networkd-wait-online.service
systemctl start systemd-networkd-wait-online.service
fi
# only allow one login. Once you enter root password, kill others.
loginfrom=$(who am i | awk '{print $2}')
who -la | grep root | grep -v "$loginfrom" | awk '{print $7}' | xargs --no-run-if-empty kill -9