]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: Fail to start/stop/reload unit if frozen 31039/head
authorAdrian Vovk <adrianvovk@gmail.com>
Wed, 24 Jan 2024 00:50:21 +0000 (19:50 -0500)
committerAdrian Vovk <adrianvovk@gmail.com>
Tue, 30 Jan 2024 16:18:16 +0000 (11:18 -0500)
commit4cb2e6af8dccfa35b1731c1f6772fdbc3b521113
tree61ca4af7cd547410af13abad91b8b7343f183917
parent16b6af6adefa4068b10e1a04f46fc895cb9a3af7
core: Fail to start/stop/reload unit if frozen

Previously, unit_{start,stop,reload} would call the low-level cgroup
unfreeze function whenever a unit was started, stopped, or reloaded. It
did so with no error checking. This call would ultimately recurse up the
cgroup tree, and unfreeze all the parent cgroups of the unit, unless an
error occurred (in which case I have no idea what would happen...)

After the freeze/thaw rework in a previous commit, this can no longer
work. If we recursively thaw the parent cgroups of the unit, there may
be sibling units marked as PARENT_FROZEN which will no longer actually
have frozen parents. Fixing this is a lot more complicated than simply
disallowing start/stop/reload on a frozen unit

Fixes https://github.com/systemd/systemd/issues/15849
src/core/job.c
src/core/job.h
src/core/unit.c
src/shared/bus-wait-for-jobs.c
test/units/testsuite-38.sh