diff options
author | msizanoen1 <msizanoen@qtmlabs.xyz> | 2022-12-07 10:38:05 +0100 |
---|---|---|
committer | msizanoen1 <msizanoen@qtmlabs.xyz> | 2022-12-08 00:54:53 +0100 |
commit | fcb0878f7563df9701a4d066378995c0b7ec32be (patch) | |
tree | c6be3cc088daf3b414528a15e241867d3451783f /src/core/slice.c | |
parent | sleep: always thaw user.slice even if freezing failed (diff) | |
download | systemd-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.c | 3 |
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 |