Bug 40901: Add systemd try-restart to koha-systemd postinst

In order for apt upgrades to trigger a service restart for all koha-systemd subservices and all instances, this adds a wildcard try-restart for those in addition to the daemon-reload. Only services which are already present and running will be restarted at postinst time

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
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:
Jake Bateman 2026-03-25 14:39:29 +00:00 committed by Pedro Amorim
parent d998990d77
commit 142ab7320f
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 8 additions and 0 deletions

View File

@ -6,6 +6,14 @@ case "$1" in
# Reload systemd daemon
systemctl daemon-reload || true
;;
# on upgrade, restart running Koha services so they pick up new code/unit files
if [ -n "$2" ]; then
deb-systemd-invoke try-restart \
'koha-*@*.service' \
>/dev/null || true
fi
esac
#DEBHELPER#