Always disable systemd-networkd if both managers enabled

NetworkManager and systemd-networkd should never both be enabled
at the same time. In this case, disable systemd-networkd, with
message to the user that this is being done.
This commit is contained in:
Ian Goodacre
2025-03-16 09:57:53 +00:00
committed by Igor
parent 28df43da15
commit 36c4b913e3

View File

@@ -674,18 +674,11 @@ if [[ -f /root/.not_logged_in_yet && -n $(tty) ]]; then
then
echo "Both NetworkManager and systemd-networkd services are enabled."
echo "This is known to cause problems with network startup."
# If no display manager was found, assume this is a server
# with network managed by systemd-networkd. Otherwise, assume
# it is a workstation with network managed by NetworkManager.
if [[ "${desktop_dm}" == "none" ]]; then
echo "No Display Manager detected: NetworkManager will be disabled"
systemctl stop NetworkManager
systemctl disable NetworkManager
else
echo "${desktop_dm} Display Manager detected: systemd-networkd will be disabled"
echo "systemd-networkd will be disabled..."
sleep 30 # Give the user time to see the message
systemctl stop systemd-networkd
systemctl disable systemd-networkd
fi
echo "systemd-networkd has been disabled."
fi
if