From 53ebfcb8c52f06c3bda13ee5912290a3374b521b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 21 May 2026 17:48:33 +0100 Subject: [PATCH] Bug 40901: (QA follow-up) koha-disable must disable units even when stopped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On systemd, koha-disable gated both --stop and --disable behind is_*_running checks (systemctl is-active). A service that was enabled but not currently active (e.g. stopped for maintenance) was therefore never disabled, leaving its unit enabled and able to restart on the next boot — so the instance was never truly disabled. Separate the concerns: keep the is_*_running guard around --stop (so we don't try to stop an already-stopped service), but call --disable unconditionally for plack, zebra, indexer, and es-indexer. The disable call is idempotent on both systemd and SysV, so calling it on an already- disabled unit is safe. SIP was already handled correctly (using is_sip_enabled). Worker units already used || true so were unaffected. Signed-off-by: Martin Renvoize Signed-off-by: Pedro Amorim --- debian/scripts/koha-disable | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/scripts/koha-disable b/debian/scripts/koha-disable index ae95e3d8da..1a14b1660a 100755 --- a/debian/scripts/koha-disable +++ b/debian/scripts/koha-disable @@ -69,20 +69,20 @@ do fi if is_plack_running $name; then koha-plack --stop $name - koha-plack --disable $name fi + koha-plack --disable $name if is_zebra_running $name; then koha-zebra --stop $name - koha-zebra --disable $name fi + koha-zebra --disable $name if is_indexer_running $name; then koha-indexer --stop $name - koha-indexer --disable $name fi + koha-indexer --disable $name if is_es_indexer_running $name; then koha-es-indexer --stop $name - koha-es-indexer --disable $name fi + koha-es-indexer --disable $name koha-worker --all-queues --stop $name || /bin/true koha-worker --all-queues --disable $name || /bin/true elif [ "$RET" = 2 ]; then