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
Created attachment 28278 [details] [review] Proposed path To test: In order to easily get the pid of the controlling process add pid_file='/tmp/sippid' option to the servers section of your SIPConfig, this saves you from having to look at ps or equivalent to get the relevant pid `cat /tmp/sippid` will return it. The sip server will update the file and remove it on a clean shutdown. If not running the process as root, designate a location writable by the running process. While running kill -s HUP sippid will restart all children of server (in ps view the pids of the child processes will have changed) ( it reattaches the socket it is listening on) kill -s QUIT sippid will shutdown the server and its children
Created attachment 28720 [details] [review] 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>
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>
Should the status of this report be already Passed QA? Looking at the attachment name and two sign-offs..
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..
Patch pushed to master. Thanks Colin!