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>
(cherry picked from commit 02392b0c2b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2023-03-03 15:31:21 +00:00 committed by Martin Renvoize
parent 53ddfb3510
commit 019791238a
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

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