]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/slice: skip member units without realized cgroup during freeze or thaw
authormsizanoen1 <msizanoen@qtmlabs.xyz>
Wed, 7 Dec 2022 09:38:05 +0000 (16:38 +0700)
committermsizanoen1 <msizanoen@qtmlabs.xyz>
Wed, 7 Dec 2022 23:54:53 +0000 (00:54 +0100)
This ensures that services with `RemainAfterExit` but without any
process running won't cause failure during freeze.

src/core/slice.c

index c453aa033e7115bbeadea61c05e793226785abfe..4824a300d0718c4c45e4aa82d0467ff8cb5407aa 100644 (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