1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-03 01:17:45 +03:00

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.

(cherry picked from commit fcb0878f75)
This commit is contained in:
msizanoen1 2022-12-07 16:38:05 +07:00 committed by Zbigniew Jędrzejewski-Szmek
parent 3cc124a513
commit 2eb040f36f

View File

@ -381,6 +381,9 @@ static int slice_freezer_action(Unit *s, FreezerAction action) {
} }
UNIT_FOREACH_DEPENDENCY(member, s, UNIT_ATOM_SLICE_OF) { UNIT_FOREACH_DEPENDENCY(member, s, UNIT_ATOM_SLICE_OF) {
if (!member->cgroup_realized)
continue;
if (action == FREEZER_FREEZE) if (action == FREEZER_FREEZE)
r = UNIT_VTABLE(member)->freeze(member); r = UNIT_VTABLE(member)->freeze(member);
else else