systemd: update for network-online.target for systemd >= 200 (rh #787314)

systemd's new network-online target abstracts the "wait until
networking is up" stuff, and NM-wait-online implements that
functionality.  Thus NM-wait-online should be ordered before
(and thus be a dependency of) network-online.
This commit is contained in:
Dan Williams
2013-05-15 07:37:25 -05:00
parent 06a415d9ea
commit db3ad9bc90
5 changed files with 24 additions and 4 deletions

View File

@@ -267,6 +267,9 @@ if test "$with_systemdsystemunitdir" != no; then
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
fi
PKG_CHECK_MODULES(SYSTEMD_200, [systemd >= 200], [have_systemd_200=yes],[have_systemd_200=no])
AM_CONDITIONAL(HAVE_SYSTEMD_200, test "${have_systemd_200}" = "yes")
# session tracking support
AC_MSG_CHECKING([Session tracking support])
AC_ARG_WITH(session-tracking, AS_HELP_STRING([--with-session-tracking=systemd|consolekit|no],

View File

@@ -8,8 +8,13 @@ systemdsystemunit_DATA = \
NetworkManager.service: NetworkManager.service.in
$(edit) $< >$@
if HAVE_SYSTEMD_200
NetworkManager-wait-online.service: NetworkManager-wait-online.service.in
$(edit) $< >$@
else
NetworkManager-wait-online.service: NetworkManager-wait-online-systemd-pre200.service.in
$(edit) $< >$@
endif
NetworkManager-dispatcher.service: NetworkManager-dispatcher.service.in
$(edit) $< >$@
@@ -38,6 +43,7 @@ edit = sed \
EXTRA_DIST = \
NetworkManager.service.in \
NetworkManager-wait-online.service.in \
NetworkManager-wait-online-systemd-pre200.service.in \
NetworkManager-dispatcher.service.in \
org.freedesktop.NetworkManager.service.in \
server.conf.in

View File

@@ -0,0 +1,13 @@
[Unit]
Description=Network Manager Wait Online
Requisite=NetworkManager.service
After=NetworkManager.service
Wants=network.target
Before=network.target
[Service]
Type=oneshot
ExecStart=@bindir@/nm-online -q --timeout=30
[Install]
WantedBy=network.target

View File

@@ -3,11 +3,11 @@ Description=Network Manager Wait Online
Requisite=NetworkManager.service
After=NetworkManager.service
Wants=network.target
Before=network.target
Before=network.target network-online.target
[Service]
Type=oneshot
ExecStart=@bindir@/nm-online -q --timeout=30
[Install]
WantedBy=network.target
WantedBy=multi-user.target

View File

@@ -1,6 +1,5 @@
[Unit]
Description=Network Manager
After=syslog.target
Wants=network.target
Before=network.target
@@ -14,5 +13,4 @@ KillMode=process
[Install]
WantedBy=multi-user.target
Alias=dbus-org.freedesktop.NetworkManager.service
Also=NetworkManager-wait-online.service