Bug 40901: (QA follow-up) Fix koha-disable --disable idempotency under set -e

koha-plack, koha-zebra, koha-indexer and koha-es-indexer all return
exit code 1 when asked to disable a service that is already disabled.
koha-disable has set -e, so this propagated as a fatal error when
koha-create called koha-disable on a freshly-created instance (where
none of the per-service configs are enabled yet).

Apply the same || true guard that koha-worker already had to the four
unconditional --disable calls. The desired postcondition (service
disabled) is achieved either way; the exit code from the sub-script
is not meaningful here.

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 09:23:02 +01:00 committed by Pedro Amorim
parent 6b54ee976b
commit 445b955b78
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 4 additions and 4 deletions

View File

@ -70,19 +70,19 @@ do
if is_plack_running $name; then
koha-plack --stop $name
fi
koha-plack --disable $name
koha-plack --disable $name || true
if is_zebra_running $name; then
koha-zebra --stop $name
fi
koha-zebra --disable $name
koha-zebra --disable $name || true
if is_indexer_running $name; then
koha-indexer --stop $name
fi
koha-indexer --disable $name
koha-indexer --disable $name || true
if is_es_indexer_running $name; then
koha-es-indexer --stop $name
fi
koha-es-indexer --disable $name
koha-es-indexer --disable $name || true
koha-worker --all-queues --stop $name || /bin/true
koha-worker --all-queues --disable $name || /bin/true
elif [ "$RET" = 2 ]; then