Koha-clms/debian/scripts
Martin Renvoize 0bdb94bfbb
Bug 40901: (QA follow-up) Harden the service abstraction in koha-functions.sh
- koha_init_backend relied on "systemctl list-unit-files" exiting
  non-zero when nothing matches. That behaviour is version dependent,
  and on a systemd host running koha-sysv a false positive would send
  every koha-* helper to units that do not exist. Test for the
  koha-plack@.service unit file instead: unambiguous, and no systemctl
  fork per call. The _KOHA_INIT_BACKEND cache is dropped; every caller
  ran the function in a $(...) subshell so it never took effect anyway.
- The _sysv_worker and _sysv_z3950 code moved here from bash-only
  scripts brought "((error_count++))" and "[[ ! $VAR ]]" into a
  #!/bin/sh library that koha-disable, koha-enable, koha-remove,
  koha-list and the init script source under dash. Use POSIX
  equivalents.
- _sysv_restart_zebra and _sysv_restart_sip lost the explicit
  "return 0" of the original quiet not-running branch, so a start
  failure now aborted the caller's whole instance loop under set -e
  (including the init script's restart across all instances). Restore
  it.
- systemctl status is run with --no-pager from koha_service_ctl and
  koha-systemd-ctl so the helpers never block on a pager.
- koha-plack --enable/--disable ran systemctl before editing the Apache
  configuration, so a systemctl failure under set -e left the vhost
  untouched. Do the systemd half after the Apache edits and warn
  instead of aborting.

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:35 +00:00
..
koha-create Bug 40901: (follow-up) koha-create enables koha@<inst>.target on systemd 2026-09-29 09:01:49 +00:00
koha-create-dirs Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-disable Bug 40901: (QA follow-up) Fix koha-disable --disable idempotency under set -e 2026-09-29 09:02:08 +00:00
koha-dump Bug 41353: koha-dump failing on mysqldump PROCESS privileges 2026-04-23 09:24:58 -06:00
koha-dump-defaults Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-elasticsearch Bug 36550: allow defaults to be defined for koha-elasticsearch 2026-04-15 11:37:17 -06:00
koha-email-disable Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-email-enable Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-enable Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-es-indexer Bug 40901: (testing follow-up) Added enable / disable to more helpers 2026-09-29 09:01:29 +00:00
koha-foreach Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-functions.sh Bug 40901: (QA follow-up) Harden the service abstraction in koha-functions.sh 2026-09-29 09:02:35 +00:00
koha-generate-env Bug 40901: (QA follow-up) Make koha-common.service a dependency-free shim 2026-09-29 09:02:30 +00:00
koha-indexer Bug 40901: (follow-up) Fix critical bugs in systemd integration 2026-09-29 09:01:33 +00:00
koha-list Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-mysql Revert "Bug 41099: Make `koha-mysql` disable SSL if required" 2025-10-31 11:26:10 -06:00
koha-mysqlcheck Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-passwd Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-plack Bug 40901: (QA follow-up) Harden the service abstraction in koha-functions.sh 2026-09-29 09:02:35 +00:00
koha-rebuild-zebra Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-remove Bug 40901: (follow-up) koha-remove leaves koha@<inst>.target enabled 2026-09-29 09:01:52 +00:00
koha-reset-passwd Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-restore Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-run-backups Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-shell Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-sip Bug 40901: (follow-up) sip.enabled is an anti-pattern for systemd 2026-09-29 09:01:48 +00:00
koha-sitemap Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-translate Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-upgrade-schema Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-upgrade-to-3.4 Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
koha-worker Bug 40901: (testing follow-up) Added enable / disable to more helpers 2026-09-29 09:01:29 +00:00
koha-z3950-responder Bug 40901: (follow-up) Fix incomplete systemd wiring in helpers 2026-09-29 09:01:34 +00:00
koha-zebra Bug 40901: (testing follow-up) Added enable / disable to more helpers 2026-09-29 09:01:29 +00:00