systemd: pull in network.service and introduce NetworkManager-wait-online.service
This pulls in network.target from NetworkManager.service (and not the other way round), as suggested and agreed on on the systemd ML: http://lists.freedesktop.org/archives/systemd-devel/2011-March/001692.html This also introduces an auxiliary service NetworkManager-wait-online.service that can be used to order a unit after the point where the network is available. When this is enabled with "systemd enable NetworkManager-wait-online.service" the unit network.target will be delayed until the network is up, which is suitable for synchronizing NFS mounts and similar to it. https://bugzilla.redhat.com/show_bug.cgi?id=692008
This commit is contained in:

committed by
Dan Williams

parent
1a61a0a2ca
commit
c4d387efb8
1
.gitignore
vendored
1
.gitignore
vendored
@@ -179,6 +179,7 @@ policy/org.freedesktop.network-manager-settings.system.policy
|
||||
policy/org.freedesktop.NetworkManager.policy
|
||||
|
||||
data/NetworkManager.service
|
||||
data/NetworkManager-wait-online.service
|
||||
data/org.freedesktop.NetworkManager.service
|
||||
|
||||
cli/src/nmcli
|
||||
|
@@ -1,10 +1,15 @@
|
||||
|
||||
if HAVE_SYSTEMD
|
||||
systemdsystemunit_DATA = NetworkManager.service
|
||||
systemdsystemunit_DATA = \
|
||||
NetworkManager.service \
|
||||
NetworkManager-wait-online.service
|
||||
|
||||
NetworkManager.service: NetworkManager.service.in
|
||||
$(edit) $< >$@
|
||||
|
||||
NetworkManager-wait-online.service: NetworkManager-wait-online.service.in
|
||||
$(edit) $< >$@
|
||||
|
||||
servicedir = $(datadir)/dbus-1/system-services
|
||||
service_in_files = org.freedesktop.NetworkManager.service.in
|
||||
service_DATA = $(service_in_files:.service.in=.service)
|
||||
@@ -14,13 +19,14 @@ $(service_DATA): $(service_in_files) Makefile
|
||||
endif
|
||||
|
||||
edit = sed \
|
||||
-e 's|@bindir[@]|$(bindir)|g' \
|
||||
-e 's|@sbindir[@]|$(sbindir)|g' \
|
||||
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
|
||||
-e 's|@localstatedir[@]|$(localstatedir)|g'
|
||||
|
||||
EXTRA_DIST = \
|
||||
NetworkManager.service.in \
|
||||
NetworkManager-wait-online.service.in \
|
||||
org.freedesktop.NetworkManager.service.in
|
||||
|
||||
CLEANFILES = NetworkManager.service org.freedesktop.NetworkManager.service
|
||||
|
||||
CLEANFILES = NetworkManager.service NetworkManager-wait-online.service org.freedesktop.NetworkManager.service
|
||||
|
12
data/NetworkManager-wait-online.service.in
Normal file
12
data/NetworkManager-wait-online.service.in
Normal file
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Network Manager Wait Online
|
||||
Requires=NetworkManager.service
|
||||
Wants=network.target
|
||||
Before=network.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=@bindir@/nm-online -q --timeout=30
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@@ -1,6 +1,8 @@
|
||||
[Unit]
|
||||
Description=Network Manager
|
||||
After=syslog.target
|
||||
Wants=network.target
|
||||
Before=network.target
|
||||
|
||||
[Service]
|
||||
Type=dbus
|
||||
@@ -8,5 +10,5 @@ BusName=org.freedesktop.NetworkManager
|
||||
ExecStart=@sbindir@/NetworkManager --no-daemon
|
||||
|
||||
[Install]
|
||||
WantedBy=network.target multi-user.target
|
||||
WantedBy=multi-user.target
|
||||
Alias=dbus-org.freedesktop.NetworkManager.service
|
||||
|
Reference in New Issue
Block a user