mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-20 04:40:04 +01:00
Since both `NetworkManager.service` and `NetworkManager-initrd.service` are allocated for the same bus name (`org.freedesktop.NetworkManager`) and this is not allowed, the best option is to use a systemd generator to install them only in the initrd, instead of setting fixed Install sections. Fixes #1814
24 lines
960 B
SYSTEMD
24 lines
960 B
SYSTEMD
[Unit]
|
|
Description=NetworkManager (initrd)
|
|
AssertPathExists=/etc/initrd-release
|
|
DefaultDependencies=no
|
|
Wants=systemd-udev-trigger.service network.target
|
|
After=systemd-udev-trigger.service network-pre.target dbus.service NetworkManager-config-initrd.service
|
|
Before=network.target
|
|
BindsTo=dbus.service
|
|
ConditionPathExists=/run/NetworkManager/initrd/neednet
|
|
ConditionPathExistsGlob=|/usr/lib/NetworkManager/system-connections/*
|
|
ConditionPathExistsGlob=|/run/NetworkManager/system-connections/*
|
|
ConditionPathExistsGlob=|/etc/NetworkManager/system-connections/*
|
|
|
|
[Service]
|
|
Type=dbus
|
|
BusName=org.freedesktop.NetworkManager
|
|
ExecReload=/usr/bin/busctl call org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager Reload u 0
|
|
ExecStart=@sbindir@/NetworkManager
|
|
# NM doesn't want systemd to kill its children for it
|
|
KillMode=process
|
|
Environment=NM_CONFIG_ENABLE_TAG=initrd
|
|
Restart=on-failure
|
|
ProtectSystem=true
|
|
ProtectHome=read-only
|