Blame SOURCES/0750-core-add-a-Requires-dependency-between-units-and-the.patch

17b0f1
From 0600681f04e3818282a2d518ec3e6afee85f7978 Mon Sep 17 00:00:00 2001
17b0f1
From: Lennart Poettering <lennart@poettering.net>
17b0f1
Date: Tue, 29 Sep 2015 13:06:28 +0200
17b0f1
Subject: [PATCH] core: add a "Requires=" dependency between units and the
17b0f1
 slices they are located in
17b0f1
17b0f1
We place the processes we fork off in the cgroup anyway, and we probably
17b0f1
shouldn't be able to get that far if we couldn't set up the slice due to
17b0f1
resource problems or unmet conditions. Hence upgrade the dependency
17b0f1
between units and the slices they are located in from Wants= to
17b0f1
Requires=.
17b0f1
17b0f1
(cherry picked from commit 8c8da0e0cb498245c765732cf9caa081a70c560f)
17b0f1
17b0f1
Related: #1718953
17b0f1
---
17b0f1
 src/core/unit.c | 6 +++---
17b0f1
 1 file changed, 3 insertions(+), 3 deletions(-)
17b0f1
17b0f1
diff --git a/src/core/unit.c b/src/core/unit.c
17b0f1
index 37fac8db3a..1dff541ac3 100644
17b0f1
--- a/src/core/unit.c
17b0f1
+++ b/src/core/unit.c
17b0f1
@@ -1113,12 +1113,12 @@ static int unit_add_slice_dependencies(Unit *u) {
17b0f1
                 return 0;
17b0f1
 
17b0f1
         if (UNIT_ISSET(u->slice))
17b0f1
-                return unit_add_two_dependencies(u, UNIT_AFTER, UNIT_WANTS, UNIT_DEREF(u->slice), true);
17b0f1
+                return unit_add_two_dependencies(u, UNIT_AFTER, UNIT_REQUIRES, UNIT_DEREF(u->slice), true);
17b0f1
 
17b0f1
-        if (streq(u->id, SPECIAL_ROOT_SLICE))
17b0f1
+        if (unit_has_name(u, SPECIAL_ROOT_SLICE))
17b0f1
                 return 0;
17b0f1
 
17b0f1
-        return unit_add_two_dependencies_by_name(u, UNIT_AFTER, UNIT_WANTS, SPECIAL_ROOT_SLICE, NULL, true);
17b0f1
+        return unit_add_two_dependencies_by_name(u, UNIT_AFTER, UNIT_REQUIRES, SPECIAL_ROOT_SLICE, NULL, true);
17b0f1
 }
17b0f1
 
17b0f1
 static int unit_add_mount_dependencies(Unit *u) {