Koha-clms/debian/systemd
Martin Renvoize 3fb9421561
Bug 40901: (QA follow-up) Make koha-common.service a dependency-free shim
The compat unit declared BindsTo=koha.target and After=koha.target while
its ExecStop ran "systemctl stop koha.target". After= orders this unit's
stop before the target's, so the ExecStop waited on a job that could not
run until the ExecStop itself finished. Every "systemctl stop koha-common"
and every "systemctl restart koha-common" hung for TimeoutStopSec (90s
by default) and left the unit in failed state. An async --no-block stop
does not help either: the queued target stop replaces the start job the
restart transaction needs, and everything ends up stopped.

Drop the dependencies. The unit is now a plain oneshot with
RemainAfterExit that starts koha.target in ExecStart and stops it in
ExecStop, which is all the old "service koha-common" UX requires.
Verified with a replica set of user units: start, stop and restart of
the shim each complete in well under a second, restart gives every
service a new PID, and managing koha.target directly is unaffected.
The one cosmetic consequence is that the shim stays "active (exited)"
if koha.target is stopped behind its back; README.Debian says to look
at koha.target for real status.

Also sets SyslogIdentifier so its journal lines are identifiable.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-29 09:02:30 +00:00
..
koha-common.service Bug 40901: (QA follow-up) Make koha-common.service a dependency-free shim 2026-09-29 09:02:30 +00:00
koha-create-dirs@.service Bug 40901: (follow-up) Order per-component units after koha-create-dirs 2026-09-29 09:01:56 +00:00
koha-es-indexer@.service Bug 40901: (follow-up) Systemd hardening 2026-09-29 09:01:59 +00:00
koha-indexer@.service Bug 40901: (follow-up) Systemd hardening 2026-09-29 09:01:59 +00:00
koha-plack@.service Bug 40901: (QA follow-up) Use /run instead of legacy /var/run in unit files 2026-09-29 09:02:19 +00:00
koha-sip@.service Bug 40901: (follow-up) Systemd hardening 2026-09-29 09:01:59 +00:00
koha-systemd-ctl Bug 40901: (QA follow-up) Move ES indexer re-discovery into koha-systemd-ctl 2026-09-29 09:02:17 +00:00
koha-worker-long_tasks@.service Bug 40901: (follow-up) Systemd hardening 2026-09-29 09:01:59 +00:00
koha-worker@.service Bug 40901: (follow-up) Systemd hardening 2026-09-29 09:01:59 +00:00
koha-z3950@.service Bug 40901: (QA follow-up) Use /run instead of legacy /var/run in unit files 2026-09-29 09:02:19 +00:00
koha-zebra@.service Bug 40901: (QA follow-up) Use /run instead of legacy /var/run in unit files 2026-09-29 09:02:19 +00:00
koha.target
…
koha@.target Bug 40901: (follow-up) Drop redundant StopWhenUnneeded on koha@.target 2026-09-29 09:01:58 +00:00