Bug 40901: (QA follow-up) Drop redundant ExecStart systemctl call in koha-common.service

koha-common.service already declares BindsTo=koha.target and
After=koha.target.  BindsTo= implies Requires=, so systemd will start
koha.target automatically when this compat unit starts and will wait for
it to be active before proceeding.  The explicit

    ExecStart=/bin/systemctl start koha.target

was therefore redundant, and calling systemctl from within a service body
is an anti-pattern (it makes an extra D-Bus round-trip back to PID 1 and
can deadlock in edge cases during early boot).

Replace with /bin/true so the oneshot succeeds immediately after the
ExecStartPre ES-indexer discovery step.  ExecStop is kept as-is because
there is no declarative equivalent for "stopping this unit should stop
koha.target" — BindsTo= only propagates stops in the other direction.

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:
Martin Renvoize 2026-05-22 07:29:55 +01:00 committed by Pedro Amorim
parent 868947cb55
commit 3eb65c1041
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ After=koha.target
Type=oneshot
RemainAfterExit=yes
ExecStartPre=+/bin/sh -c 'for i in $(koha-list --enabled --elasticsearch 2>/dev/null); do systemctl enable --now "koha-es-indexer@$i.service" 2>/dev/null || true; done'
ExecStart=/bin/systemctl start koha.target
ExecStart=/bin/true
ExecStop=/bin/systemctl stop koha.target
[Install]