mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-22 02:35:25 +00:00
![Alan Jenkins](/assets/img/avatar_default.png)
This is the approach used by systemd-networkd.
I don't understand the logic that caused systemd-networkd to make the change -
9e49656037
Instead, I am suggesting it for consistency, and because it seems to me this is the
exact correct behaviour. Because if you enable NetworkManager, and rely on it to
configure your network devices, then network mounts will not start correctly at boot
time unless you also enable NetworkManager-wait-online.service.
Enabling NetworkManager-wait-online.service does not cause unnecessary serialization
of the boot process; it is only pulled in if something else (like a network mount)
pulls in network-online.target.
I am suggesting this in response to reading this user support request [1].
[1] https://unix.stackexchange.com/questions/429604/fstab-not-automatically-mounting-smb-storage
[thaller@redhat.com: reworded commit message]
https://github.com/NetworkManager/NetworkManager/pull/76
35 lines
1.3 KiB
SYSTEMD
35 lines
1.3 KiB
SYSTEMD
[Unit]
|
|
Description=Network Manager
|
|
Documentation=man:NetworkManager(8)
|
|
Wants=network.target
|
|
After=network-pre.target dbus.service
|
|
Before=network.target @DISTRO_NETWORK_SERVICE@
|
|
|
|
[Service]
|
|
Type=dbus
|
|
BusName=org.freedesktop.NetworkManager
|
|
ExecReload=/usr/bin/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.Reload uint32:0
|
|
#ExecReload=/bin/kill -HUP $MAINPID
|
|
ExecStart=@sbindir@/NetworkManager --no-daemon
|
|
Restart=on-failure
|
|
# NM doesn't want systemd to kill its children for it
|
|
KillMode=process
|
|
CapabilityBoundingSet=CAP_NET_ADMIN CAP_DAC_OVERRIDE CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_MODULE CAP_AUDIT_WRITE CAP_KILL CAP_SYS_CHROOT
|
|
|
|
# ibft settings plugin calls iscsiadm which needs CAP_SYS_ADMIN
|
|
#CapabilityBoundingSet=CAP_SYS_ADMIN
|
|
|
|
ProtectSystem=true
|
|
ProtectHome=read-only
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
Alias=dbus-org.freedesktop.NetworkManager.service
|
|
Also=NetworkManager-dispatcher.service
|
|
|
|
# We want to enable NetworkManager-wait-online.service whenever this service
|
|
# is enabled. NetworkManager-wait-online.service has
|
|
# WantedBy=network-online.target, so enabling it only has an effect if
|
|
# network-online.target itself is enabled or pulled in by some other unit.
|
|
Also=NetworkManager-wait-online.service
|