|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
From 3d08427e07af2419f542c3786db2e78f0ed7c282 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
From: Lennart Poettering <lennart@poettering.net>
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
Date: Thu, 18 Feb 2016 22:51:23 +0100
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
Subject: [PATCH] core: exclude .slice units from "systemctl isolate"
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
Fixes: #1969
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
(cherry picked from commit 1b4cd0cf11feb7d41f2eff17f86fa55b31bb6841)
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
src/core/scope.c | 3 +--
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
src/core/slice.c | 8 ++++++++
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
2 files changed, 9 insertions(+), 2 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
diff --git a/src/core/scope.c b/src/core/scope.c
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
index c5d0ecef04..361695c3f9 100644
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
--- a/src/core/scope.c
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
+++ b/src/core/scope.c
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
@@ -50,8 +50,7 @@ static void scope_init(Unit *u) {
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
assert(u->load_state == UNIT_STUB);
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
s->timeout_stop_usec = u->manager->default_timeout_stop_usec;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
- UNIT(s)->ignore_on_isolate = true;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
+ u->ignore_on_isolate = true;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
static void scope_done(Unit *u) {
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
diff --git a/src/core/slice.c b/src/core/slice.c
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
index d65364c6f4..667f61bde5 100644
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
--- a/src/core/slice.c
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
+++ b/src/core/slice.c
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
@@ -34,6 +34,13 @@ static const UnitActiveState state_translation_table[_SLICE_STATE_MAX] = {
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
[SLICE_ACTIVE] = UNIT_ACTIVE
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
};
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
+static void slice_init(Unit *u) {
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
+ assert(u);
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
+ assert(u->load_state == UNIT_STUB);
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
+ u->ignore_on_isolate = true;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
+}
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
static void slice_set_state(Slice *t, SliceState state) {
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
SliceState old_state;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
assert(t);
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
@@ -305,6 +312,7 @@ const UnitVTable slice_vtable = {
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
.no_instances = true,
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
.can_transient = true,
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
+ .init = slice_init,
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
.load = slice_load,
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
.coldplug = slice_coldplug,
|