valeriyvdovin / rpms / systemd

Forked from rpms/systemd 4 years ago
Clone

Blame SOURCES/9900-core-exclude-.slice-units-from-systemctl-isolate.patch

Pablo Greco 8bc8b4
From e3f4788affdee67e8afaea18d06d63b82a03d6e7 Mon Sep 17 00:00:00 2001
Pablo Greco 8bc8b4
From: Lennart Poettering <lennart@poettering.net>
Pablo Greco 8bc8b4
Date: Thu, 18 Feb 2016 22:51:23 +0100
Pablo Greco 8bc8b4
Subject: [PATCH 1/2] core: exclude .slice units from "systemctl isolate"
Pablo Greco 8bc8b4
Pablo Greco 8bc8b4
Fixes: #1969
Pablo Greco 8bc8b4
(cherry picked from commit 1b4cd0cf11feb7d41f2eff17f86fa55b31bb6841)
Pablo Greco 8bc8b4
Pablo Greco 8bc8b4
Resolves: #1745199
Pablo Greco 8bc8b4
---
Pablo Greco 8bc8b4
 src/core/slice.c | 8 ++++++++
Pablo Greco 8bc8b4
 1 file changed, 8 insertions(+)
Pablo Greco 8bc8b4
Pablo Greco 8bc8b4
diff --git a/src/core/slice.c b/src/core/slice.c
Pablo Greco 8bc8b4
index 0985a65..b076920 100644
Pablo Greco 8bc8b4
--- a/src/core/slice.c
Pablo Greco 8bc8b4
+++ b/src/core/slice.c
Pablo Greco 8bc8b4
@@ -36,6 +36,13 @@ static const UnitActiveState state_translation_table[_SLICE_STATE_MAX] = {
Pablo Greco 8bc8b4
         [SLICE_ACTIVE] = UNIT_ACTIVE
Pablo Greco 8bc8b4
 };
Pablo Greco 8bc8b4
 
Pablo Greco 8bc8b4
+static void slice_init(Unit *u) {
Pablo Greco 8bc8b4
+        assert(u);
Pablo Greco 8bc8b4
+        assert(u->load_state == UNIT_STUB);
Pablo Greco 8bc8b4
+
Pablo Greco 8bc8b4
+        u->ignore_on_isolate = true;
Pablo Greco 8bc8b4
+}
Pablo Greco 8bc8b4
+
Pablo Greco 8bc8b4
 static void slice_set_state(Slice *t, SliceState state) {
Pablo Greco 8bc8b4
         SliceState old_state;
Pablo Greco 8bc8b4
         assert(t);
Pablo Greco 8bc8b4
@@ -274,6 +281,7 @@ const UnitVTable slice_vtable = {
Pablo Greco 8bc8b4
         .no_instances = true,
Pablo Greco 8bc8b4
         .can_transient = true,
Pablo Greco 8bc8b4
 
Pablo Greco 8bc8b4
+        .init = slice_init,
Pablo Greco 8bc8b4
         .load = slice_load,
Pablo Greco 8bc8b4
 
Pablo Greco 8bc8b4
         .coldplug = slice_coldplug,
Pablo Greco 8bc8b4
-- 
Pablo Greco 8bc8b4
1.8.3.1
Pablo Greco 8bc8b4