systemd: don't make NetworkManager D-Bus activatable
If the NetworkManager daemon has been stopped manually we don't want it to be autostarted by a client request. [lkundrak@v3.sk: The auto-activation is probably more surprising than useful. Services that need NetworkManager API should depend on NetworkManager service directly. I have no idea what purpose does the D-Bus service file serve nowadays, but it looks rather hacky (really, activating /bin/false) and the comment in it suggests that the autoactivating behavior was not intended anyway. Debian has been shipping this for quite some time and no complains have been heard.] https://github.com/NetworkManager/NetworkManager/pull/230
This commit is contained in:

committed by
Lubomir Rintel

parent
cec7ade86c
commit
90f71c0f99
@@ -4140,11 +4140,6 @@ endif
|
|||||||
data/NetworkManager-dispatcher.service: $(srcdir)/data/NetworkManager-dispatcher.service.in
|
data/NetworkManager-dispatcher.service: $(srcdir)/data/NetworkManager-dispatcher.service.in
|
||||||
$(AM_V_GEN) $(data_edit) $< >$@
|
$(AM_V_GEN) $(data_edit) $< >$@
|
||||||
|
|
||||||
data/org.freedesktop.NetworkManager.service: $(srcdir)/data/org.freedesktop.NetworkManager.service.in
|
|
||||||
$(AM_V_GEN) $(data_edit) $< >$@
|
|
||||||
|
|
||||||
service_DATA += data/org.freedesktop.NetworkManager.service
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
examples_DATA += data/server.conf
|
examples_DATA += data/server.conf
|
||||||
@@ -4166,7 +4161,6 @@ EXTRA_DIST += \
|
|||||||
data/NetworkManager-wait-online.service.in \
|
data/NetworkManager-wait-online.service.in \
|
||||||
data/NetworkManager-wait-online-systemd-pre200.service.in \
|
data/NetworkManager-wait-online-systemd-pre200.service.in \
|
||||||
data/NetworkManager-dispatcher.service.in \
|
data/NetworkManager-dispatcher.service.in \
|
||||||
data/org.freedesktop.NetworkManager.service.in \
|
|
||||||
data/84-nm-drivers.rules \
|
data/84-nm-drivers.rules \
|
||||||
data/85-nm-unmanaged.rules \
|
data/85-nm-unmanaged.rules \
|
||||||
data/90-nm-thunderbolt.rules \
|
data/90-nm-thunderbolt.rules \
|
||||||
@@ -4177,7 +4171,6 @@ CLEANFILES += \
|
|||||||
data/NetworkManager.service \
|
data/NetworkManager.service \
|
||||||
data/NetworkManager-wait-online.service \
|
data/NetworkManager-wait-online.service \
|
||||||
data/NetworkManager-dispatcher.service \
|
data/NetworkManager-dispatcher.service \
|
||||||
data/org.freedesktop.NetworkManager.service \
|
|
||||||
data/server.conf
|
data/server.conf
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@@ -817,7 +817,6 @@ fi
|
|||||||
%dir %{_localstatedir}/lib/NetworkManager
|
%dir %{_localstatedir}/lib/NetworkManager
|
||||||
%dir %{_sysconfdir}/NetworkManager/system-connections
|
%dir %{_sysconfdir}/NetworkManager/system-connections
|
||||||
%dir %{_sysconfdir}/sysconfig/network-scripts
|
%dir %{_sysconfdir}/sysconfig/network-scripts
|
||||||
%{_datadir}/dbus-1/system-services/org.freedesktop.NetworkManager.service
|
|
||||||
%{_datadir}/dbus-1/system-services/org.freedesktop.nm_dispatcher.service
|
%{_datadir}/dbus-1/system-services/org.freedesktop.nm_dispatcher.service
|
||||||
%{_datadir}/polkit-1/actions/*.policy
|
%{_datadir}/polkit-1/actions/*.policy
|
||||||
%{_prefix}/lib/udev/rules.d/*.rules
|
%{_prefix}/lib/udev/rules.d/*.rules
|
||||||
|
@@ -24,7 +24,6 @@ ProtectHome=read-only
|
|||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
Alias=dbus-org.freedesktop.NetworkManager.service
|
|
||||||
Also=NetworkManager-dispatcher.service
|
Also=NetworkManager-dispatcher.service
|
||||||
|
|
||||||
# We want to enable NetworkManager-wait-online.service whenever this service
|
# We want to enable NetworkManager-wait-online.service whenever this service
|
||||||
|
@@ -18,23 +18,22 @@ configure_file(
|
|||||||
|
|
||||||
if install_systemd_unit_dir
|
if install_systemd_unit_dir
|
||||||
services = [
|
services = [
|
||||||
['NetworkManager-dispatcher.service', systemd_system_unit_dir],
|
'NetworkManager-dispatcher.service',
|
||||||
['NetworkManager.service', systemd_system_unit_dir],
|
'NetworkManager.service',
|
||||||
['org.freedesktop.NetworkManager.service', dbus_sys_dir]
|
|
||||||
]
|
]
|
||||||
|
|
||||||
if have_systemd_200
|
if have_systemd_200
|
||||||
services += [['NetworkManager-wait-online.service', systemd_system_unit_dir]]
|
services += ['NetworkManager-wait-online.service']
|
||||||
else
|
else
|
||||||
services += [['NetworkManager-wait-online-systemd-pre200.service', systemd_system_unit_dir]]
|
services += ['NetworkManager-wait-online-systemd-pre200.service']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
foreach service: services
|
foreach service: services
|
||||||
configure_file(
|
configure_file(
|
||||||
input: service[0] + '.in',
|
input: service + '.in',
|
||||||
output: service[0],
|
output: service,
|
||||||
install: true,
|
install: true,
|
||||||
install_dir: service[1],
|
install_dir: systemd_system_unit_dir,
|
||||||
configuration: data_conf
|
configuration: data_conf
|
||||||
)
|
)
|
||||||
endforeach
|
endforeach
|
||||||
|
@@ -1,11 +0,0 @@
|
|||||||
# This D-Bus service activation file is only for systemd support since
|
|
||||||
# an auto-activated NetworkManager would be quite surprising for those people
|
|
||||||
# who have NM installed but turned off. Thus the Exec path available to
|
|
||||||
# D-Bus is /bin/false, but systemd knows the real Exec path due to the NM
|
|
||||||
# systemd .service file.
|
|
||||||
|
|
||||||
[D-BUS Service]
|
|
||||||
Name=org.freedesktop.NetworkManager
|
|
||||||
Exec=/bin/false
|
|
||||||
User=root
|
|
||||||
SystemdService=dbus-org.freedesktop.NetworkManager.service
|
|
Reference in New Issue
Block a user