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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2023-03-03 15:31:21 +00:00 committed by Tomas Cohen Arazi
parent 8e00746095
commit 02392b0c2b
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -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