Description
Liz Rea
2020-03-26 15:08:16 UTC
Created attachment 101874 [details] [review] 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 I think this needs to be updated after bug 24993 got pushed? Created attachment 120638 [details] [review] 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 Created attachment 129807 [details] [review] 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 Signed-off-by: Owen Leonard <oleonard@myacpl.org> This patch looks trivial, but it's not. 1. There is blank line if restart called and sip is stopped. I will fix. 2. There is no consistency on --restart behaviour for debian scripts. Some stop && start, others don't start if was stopped. Not considering blocker but noting it. 3. Wondering if we won't hit the same problem as bug 24993, but for the start command: 170 if [ "$verbose" != "no" ]; then 171 log_daemon_msg "Warning: SIP server not running for ${name}... trying to start" 172 log_end_msg 0 173 fi 174 if is_sip_running ${name}; then 175 return 0 176 else We may not return 0 here if the startup was slow. Do you have this patch applied on production servers? % koha-sip --stop kohadev $ koha-sip --verbose --restart kohadev Starting SIP server for kohadev:. Warning: SIP server not running for kohadev... trying to start:. Not sure this is the best we can do. Created attachment 130059 [details] [review] 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 Signed-off-by: Owen Leonard <oleonard@myacpl.org> JD Amended patch: tidy the whole block Created attachment 130060 [details] [review] Bug 24991: Define noLF for the else block as well An empty line was displayed if --restart was called after --stop I think that it is inconsistent to check if SIP started in the else block while we are not doing the same for the IF block. We could move a part of the else block AFTER the end if in order to always check if SIP started. Or just not check like we did? |