Bug 40901: (follow-up) koha-remove leaves koha@<inst>.target enabled

Disable koha@<inst>.target and koha-create-dirs@<inst>.service so
their koha.target.wants/ symlinks don't outlive the instance.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Kyle M Hall 2026-05-12 11:27:41 -04:00 committed by Pedro Amorim
parent d0d193ea7e
commit 1425743c10
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 10 additions and 0 deletions

View File

@ -102,6 +102,16 @@ eof
koha-es-indexer --disable $name || /bin/true
fi
# Under systemd, disable the per-instance target and create-dirs
# oneshot so we don't leave dangling symlinks under
# /etc/systemd/system/koha.target.wants/ once the instance is gone.
if [ "$(koha_init_backend)" = "systemd" ]; then
systemctl stop "koha@${name}.target" 2>/dev/null || true
systemctl disable "koha@${name}.target" 2>/dev/null || true
systemctl stop "koha-create-dirs@${name}.service" 2>/dev/null || true
systemctl disable "koha-create-dirs@${name}.service" 2>/dev/null || true
fi
instancefile=$(get_apache_config_for $name)
le_opacdomain=$(letsencrypt_get_opacdomain_for $name)