https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40901

--- Comment #201 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 205955
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205955&action=edit
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
  [email protected] 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 <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to