From fcb0878f7563df9701a4d066378995c0b7ec32be Mon Sep 17 00:00:00 2001 From: msizanoen1 Date: Wed, 7 Dec 2022 16:38:05 +0700 Subject: [PATCH] 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. --- src/core/slice.c | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.25.1