Bug 40901: (follow-up) Preserve 'service koha-common' UX with systemd

Adds PartOf=koha.target to koha@.target so that stopping or
restarting the global target propagates to all instance targets
and their services.

Ships a koha-common.service oneshot unit that delegates to
koha.target, so 'systemctl restart koha-common' works as the
drop-in replacement for the old 'service koha-common restart'.

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:
Tomás Cohen Arazi 2026-04-29 10:32:31 -03:00 committed by Pedro Amorim
parent bf8529fbd4
commit d67d319b89
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
2 changed files with 15 additions and 0 deletions

14
debian/systemd/koha-common.service vendored Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=Koha ILS - All instances (compat)
Documentation=man:koha-common(8)
BindsTo=koha.target
After=koha.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/systemctl start koha.target
ExecStop=/bin/systemctl stop koha.target
[Install]
WantedBy=multi-user.target

View File

@ -1,6 +1,7 @@
[Unit]
Description=Koha ILS instance %i
After=network.target memcached.service mysql.service
PartOf=koha.target
StopWhenUnneeded=yes
[Install]