the sip_shutdown script rightly announces the brittleness of it approach to identifying the process to kill. A more reliable method is available by getting the server to use the standard approach of writing a pidfile which is part of Net::Server's functionality. Change script to use this and alter config scripts accordingly
Created attachment 27878 [details] [review] Proposed patch Adds options to sample config and simplifies sample shutdown script
This patch hardcodes the user and group as "koha" and "koha". You should not hardcode the user and group in the SIPConfig.xml file; those need to be gathered at the Koha creation phase, either through koha-create and koha-enable-sip for package, or with makefile.PL for git sites.
Created attachment 99533 [details] [review] Bug 12169 Use pid file in sipserver shutdown Change sample SIPConfig to request server writes a pid file Use this in shutdown rather than the current open to error method Have also added to the Config parameters to ensure that the sipserver runs as the correct user and sets its own session id. These are always useful but makes it easier for users to run up the sipserver as root at boot time similarly to apache, mysql etc Added to the sample config where to locate other server parameter documentation Removed from the sample config the unedifying, unwanted and purely historical http example
Rebased, followups to follow to appease the QA failure.
I agree with Larry here, but at the moment I'm struggling to work out where in the code I should look for using the user variables in the SIPConfig.xml template.
Are those scripts (sip_shutdown.sh and sip_run.sh)still used by anybody? It seems that they are quite obsolete. The debian package script must be used now, koha-sip has the start/stop that deals with the pid file.
(In reply to Jonathan Druart from comment #7) > Are those scripts (sip_shutdown.sh and sip_run.sh)still used by anybody? > It seems that they are quite obsolete. The debian package script must be > used now, koha-sip has the start/stop that deals with the pid file. What if someone is using Koha from a tarball installation?
Both fair points... not sure where to go with this one then.. the scripts in fact state at the very top of the file that they're 'example scripts' anyway and may need modification. I do wonder if we can deprecate them...
Well.. we still have a fair few dev/standard installs running from git/tarballs. I don't think we're alone either.. I do see chatter on the lists and irc occasionally with people asking about that install type on various OS's
(In reply to Larry Baerveldt from comment #2) > This patch hardcodes the user and group as "koha" and "koha". You should not > hardcode the user and group in the SIPConfig.xml file; those need to be > gathered at the Koha creation phase, either through koha-create and > koha-enable-sip for package, or with Makefile.PL for git sites. As far as I can tell, the file modified here is A) only an example file and B) only used for dev/standard installs and isn't referenced in the Makefile at all. So, I don't think it affects packages at all, it just makes sip work more reliably for Dev/Standard installs.
Created attachment 119001 [details] [review] Bug 12169 Use pid file in sipserver shutdown Change sample SIPConfig to request server writes a pid file Use this pid in shutdown rather than the current open to error method. Have also added to the Config parameters to ensure that the sipserver runs as the correct user and sets its own session id. These are always useful but makes it easier for users to run up the sipserver as root at boot time similarly to apache, mysql etc Added to the sample config where to locate other server parameter documentation. Removed from the sample config the unedifying, unwanted and purely historical http example Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 120702 [details] [review] Bug 12169: Use pid file in sipserver shutdown Change sample SIPConfig to request server writes a pid file Use this pid in shutdown rather than the current open to error method. Have also added to the Config parameters to ensure that the sipserver runs as the correct user and sets its own session id. These are always useful but makes it easier for users to run up the sipserver as root at boot time similarly to apache, mysql etc Added to the sample config where to locate other server parameter documentation. Removed from the sample config the unedifying, unwanted and purely historical http example Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 120703 [details] [review] Bug 12169: Fix SIPconfig.xml, restore missing end tag Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Package install already have this type of functionality. Good to see it available for non-package installs! Only open question is that of an upgrade path. I think upgrade notes will be needed.
Pushed to master for 21.11, thanks to everybody involved!
Enhancement not backported to 21.05.x