]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: do not leak resources when handling stale alias state on reload 41986/head
authorLuca Boccassi <luca.boccassi@gmail.com>
Thu, 7 May 2026 19:02:57 +0000 (20:02 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 12 May 2026 22:38:52 +0000 (23:38 +0100)
commit4f7089f0c740b9b0b5e55913282b61d851991562
tree23777aa80cd25ada173f2b3360df6d0e74aa4d67
parent98d061e28b3bc7ae93857cfd77f39da600dc357c
core: do not leak resources when handling stale alias state on reload

The fix for the corrupted state when units become aliased on reload
leaks the now-aliased unit's resources, which become untracked and
essentially lost.

While fixing the state corruption is of course necessary, leaking
processes/etc. is not ideal for a system and service manager, so
instead attempt to keep track of them by creating stub units
on-the-fly as replacements.
This way resources are not leaked, there are clear indications of
where they moved, and all state can be tracked as expected.

Ignore timers/sockets/paths as those are internal resources/triggers.

Follow-up for a77c7a8224447890a304bd857f412c8103f217f1
man/systemctl.xml
man/systemd.unit.xml
src/core/manager-serialize.c
test/units/TEST-07-PID1.alias-corruption.sh