From 7a10f875bdd488b4f11950fe0b5275f1702b7b73 Mon Sep 17 00:00:00 2001 From: Liz Rea Date: Thu, 26 Mar 2020 10:09:01 -0500 Subject: [PATCH] Bug 24991: make koha-sip --restart start sip if it is not already running. To test: - make sure SIP is enabled sudo koha-sip --enable inst - make sure SIP is running sudo koha-sip --start inst sudo koha-sip --status inst - restart SIP, make sure it does this normally sudo koha-sip --restart inst - stop SIP, make sure it does this normally sudo koha-sip --stop inst - make sure SIP is not running (wild scenario: oomkiller or similar has killed this or some other thing has happened) sudo koha-sip --status inst - restart sip, make sure it starts SIP instead of silently failing sudo koha-sip --restart inst - check SIP is now running, or that there is an error message if it can't start sudo koha-sip --status inst --- debian/scripts/koha-sip | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/debian/scripts/koha-sip b/debian/scripts/koha-sip index 00d337f075..521332c268 100755 --- a/debian/scripts/koha-sip +++ b/debian/scripts/koha-sip @@ -156,12 +156,20 @@ restart_sip() echo $noLF `stop_sip ${name}` echo $noLF `start_sip ${name}` else - if [ "$verbose" != "no" ]; then - log_daemon_msg "Warning: SIP server not running for ${name}" + echo $noLF `start_sip ${name}` + if [ "$verbose" != "no" ]; then + log_daemon_msg "Warning: SIP server not running for ${name}... trying to start" log_end_msg 0 - else - return 0 fi + if is_sip_running ${name}; then + return 0 + else + if [ "$verbose" != "no" ]; then + log_daemon_msg "Warning: SIP server not started, check your config" + log_end_msg 0 + fi + return 1 + fi fi } -- 2.11.0