Bug 12263 - SIPServer does not respond correctly to signals
Summary: SIPServer does not respond correctly to signals
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Colin Campbell
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-15 11:18 UTC by Colin Campbell
Modified: 2015-06-04 23:33 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Proposed path (2.50 KB, patch)
2014-05-15 12:13 UTC, Colin Campbell
Details | Diff | Splinter Review
Bug 12263 Fix startup issues blocking response to HUP (2.55 KB, patch)
2014-06-08 09:30 UTC, Chris Cormack
Details | Diff | Splinter Review
[PASSED QA] Bug 12263 Fix startup issues blocking response to HUP (2.62 KB, patch)
2014-06-20 16:51 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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!