Based on 805b573fad06b845502e76f3db3a0efa7583149d Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Wed, 23 Jul 2014 12:49:14 +0200
Subject: [PATCH] sysv: order initscripts which provide $network before
 network.target

Due to recent changes where $network "maps" to network-online.target
it is not guaranteed that initscript which provides networking will
be terminated after network.target during shutdown which is against LSB.
---
 src/core/service.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- src/core/service.c
+++ src/core/service.c	2014-07-30 11:27:16.074235995 +0000
@@ -820,7 +820,7 @@ static int service_load_sysv_path(Servic
 
                                         if (unit_name_to_type(m) == UNIT_SERVICE)
                                                 r = unit_merge_by_name(u, m);
-                                        else
+                                        else {
                                                 /* NB: SysV targets
                                                  * which are provided
                                                  * by a service are
@@ -835,6 +835,9 @@ static int service_load_sysv_path(Servic
                                                  * in the SysV
                                                  * services! */
                                                 r = unit_add_two_dependencies_by_name(u, UNIT_BEFORE, UNIT_WANTS, m, NULL, true);
+                                                if (r >= 0 && streq(m, SPECIAL_NETWORK_ONLINE_TARGET))
+                                                        r = unit_add_dependency_by_name(u, UNIT_BEFORE, SPECIAL_NETWORK_TARGET, NULL, true);
+                                        }
 
                                         if (r < 0)
                                                 log_error_unit(u->id,
