summaryrefslogtreecommitdiffstats
path: root/src/core/slice.c
diff options
context:
space:
mode:
authormsizanoen1 <msizanoen@qtmlabs.xyz>2022-12-07 10:38:05 +0100
committermsizanoen1 <msizanoen@qtmlabs.xyz>2022-12-08 00:54:53 +0100
commitfcb0878f7563df9701a4d066378995c0b7ec32be (patch)
treec6be3cc088daf3b414528a15e241867d3451783f /src/core/slice.c
parentsleep: always thaw user.slice even if freezing failed (diff)
downloadsystemd-fcb0878f7563df9701a4d066378995c0b7ec32be.tar.xz
systemd-fcb0878f7563df9701a4d066378995c0b7ec32be.zip
core/slice: skip member units without realized cgroup during freeze or thaw
This ensures that services with `RemainAfterExit` but without any process running won't cause failure during freeze.
Diffstat (limited to '')
-rw-r--r--src/core/slice.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/slice.c b/src/core/slice.c
index c453aa033e..4824a300d0 100644
--- a/src/core/slice.c
+++ b/src/core/slice.c
@@ -381,6 +381,9 @@ static int slice_freezer_action(Unit *s, FreezerAction action) {
}
UNIT_FOREACH_DEPENDENCY(member, s, UNIT_ATOM_SLICE_OF) {
+ if (!member->cgroup_realized)
+ continue;
+
if (action == FREEZER_FREEZE)
r = UNIT_VTABLE(member)->freeze(member);
else