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:
Michael Biebl 2015-03-29 22:57:50 +02:00 committed by Lubomir Rintel
parent cec7ade86c
commit 90f71c0f99
5 changed files with 7 additions and 28 deletions

View file

@ -4140,11 +4140,6 @@ endif
data/NetworkManager-dispatcher.service: $(srcdir)/data/NetworkManager-dispatcher.service.in
$(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
examples_DATA += data/server.conf
@ -4166,7 +4161,6 @@ EXTRA_DIST += \
data/NetworkManager-wait-online.service.in \
data/NetworkManager-wait-online-systemd-pre200.service.in \
data/NetworkManager-dispatcher.service.in \
data/org.freedesktop.NetworkManager.service.in \
data/84-nm-drivers.rules \
data/85-nm-unmanaged.rules \
data/90-nm-thunderbolt.rules \
@ -4177,7 +4171,6 @@ CLEANFILES += \
data/NetworkManager.service \
data/NetworkManager-wait-online.service \
data/NetworkManager-dispatcher.service \
data/org.freedesktop.NetworkManager.service \
data/server.conf
###############################################################################

View file

@ -817,7 +817,6 @@ fi
%dir %{_localstatedir}/lib/NetworkManager
%dir %{_sysconfdir}/NetworkManager/system-connections
%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}/polkit-1/actions/*.policy
%{_prefix}/lib/udev/rules.d/*.rules

View file

@ -24,7 +24,6 @@ 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

View file

@ -18,23 +18,22 @@ configure_file(
if install_systemd_unit_dir
services = [
['NetworkManager-dispatcher.service', systemd_system_unit_dir],
['NetworkManager.service', systemd_system_unit_dir],
['org.freedesktop.NetworkManager.service', dbus_sys_dir]
'NetworkManager-dispatcher.service',
'NetworkManager.service',
]
if have_systemd_200
services += [['NetworkManager-wait-online.service', systemd_system_unit_dir]]
services += ['NetworkManager-wait-online.service']
else
services += [['NetworkManager-wait-online-systemd-pre200.service', systemd_system_unit_dir]]
services += ['NetworkManager-wait-online-systemd-pre200.service']
endif
foreach service: services
configure_file(
input: service[0] + '.in',
output: service[0],
input: service + '.in',
output: service,
install: true,
install_dir: service[1],
install_dir: systemd_system_unit_dir,
configuration: data_conf
)
endforeach

View file

@ -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