From c6cbaad316a51e6261f343473e7b63f085af1d0a Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 3 Mar 2023 15:31:21 +0000 Subject: [PATCH] Bug 33108: (follow-up) Don't let restart die if ES indexer not running This fixes the restart action in koha-common to continue with starting services even if the last service cannot be stopped (because it may not be running) This needs a larger fix, to ensure all stopped services return a warning, for now 'do_stop' simply returns the last success/failure To test: 1 - Apply patch 2 - reset_all 3 - sudo koha-es-indexer --stop kohadev 4 - restart_all 5 - You are notified that ES indexer was not running 6 - You are notified that soem services could not be stopped 7 - The services are started --- debian/koha-common.init | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/debian/koha-common.init b/debian/koha-common.init index 4f0bae90e4..e0e74f4dd8 100755 --- a/debian/koha-common.init +++ b/debian/koha-common.init @@ -214,18 +214,21 @@ case "$1" in do_stop case "$?" in 0) - do_start - case "$?" in - 0) log_end_msg 0 ;; - *) log_end_msg 1 ;; # Failed to start - esac - ;; + log_daemon_msg "Successfully stopped all services for instance $NAME" + log_end_msg 0 + ;; *) - # Failed to stop - log_end_msg 1 - ;; + # Failed to stop something + log_daemon_msg "Failed to stop some services for instance $NAME" + log_end_msg 0 + ;; esac - ;; + do_start + case "$?" in + 0) log_end_msg 0 ;; + *) log_end_msg 1 ;; # Failed to start + esac + ;; status) zebra_status sip_status -- 2.30.2