install: allow removing symlinks even for units that are gone
authorLuca Boccassi <bluca@debian.org>
Fri, 7 Jun 2024 20:39:45 +0000 (21:39 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 18 Jun 2024 14:07:26 +0000 (16:07 +0200)
commit5163c9b1e56293b1bb2803420613c5b374570892
tree9d38b5618a5e845b3d1961bb9b096e08c109369c
parent7c6028bbcbd03f91e1c4b84dcf46b45e9672c2b6
install: allow removing symlinks even for units that are gone

If a symlink is leftover, still allow cleaning it up via 'disable'. This
happens when a unit is stopped and removed, but not disabled, and a reload
has already happened. At that point, cleaning up the old symlinks becomes
impossible through the APIs, and needs to be done manually. Always allow
cleaning up symlinks, if they exist, by only erroring out if there is an
OOM.

Follow-up for f31f10a6207efc9ae9e0b1f73975b5b610914017
src/shared/install.c
test/units/TEST-26-SYSTEMCTL.sh