Bug 12263

Summary: SIPServer does not respond correctly to signals
Product: Koha Reporter: Colin Campbell <colin.campbell>
Component: SIP2Assignee: Colin Campbell <colin.campbell>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: colin.campbell, kyle, m.de.rooy, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Proposed path
Bug 12263 Fix startup issues blocking response to HUP
[PASSED QA] Bug 12263 Fix startup issues blocking response to HUP

Description Colin Campbell 2014-05-15 11:18:32 UTC
The Sipserver class is derived from Net::Server part of Net::Server's functionality is to respond to signals with standard and pedictable behaviour.

i.e. send a HUP signal and the server should restart its children
send a QUIT signal and the server should shutdown cleanly

This does not work with the currently shipped version send a HUP and it will log that it is re-exec'ing the process but this fails
Comment 1 Colin Campbell 2014-05-15 12:13:12 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2014-06-08 09:30:13 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2014-06-20 16:51:05 UTC
Created attachment 29117 [details] [review]
[PASSED QA] Bug 12263 Fix startup issues blocking response to HUP

If you do a kill -s HUP sipserver_pid the server process
should restart its children.
This was not happening although it was logging the commencement
of the process.

Removed traces of Exporter usage this was always incorrect
this program inherits from Net::Server 'use base' to make inheritance
clearer. Removed unnecessary begin block

made file executable so it can run

added a shebang line so OS knows to invoke perl to compile and run
the file.

I've removed the debug code dumping the config to STDOUT,
it should not have gone into the production version.
One of the first things this program does is close stdout etc and
reopens the sip sockets to them. Assuming you can print to them other
than as part of the sip dialogue is not always safe.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Marcel de Rooy 2014-07-09 11:28:24 UTC
Should the status of this report be already Passed QA?
Looking at the attachment name and two sign-offs..
Comment 5 Kyle M Hall 2014-07-11 15:40:41 UTC
Yep!

(In reply to M. de Rooy from comment #4)
> Should the status of this report be already Passed QA?
> Looking at the attachment name and two sign-offs..
Comment 6 Tomás Cohen Arazi 2014-07-15 15:18:17 UTC
Patch pushed to master.

Thanks Colin!