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.
This commit is contained in:
msizanoen1
2022-12-08 00:54:53 +01:00
parent efa736d383
commit fcb0878f75
+3
View File
@@ -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