[Catalyst] Killing the standalone perl server programatically

Ton Voon ton.voon at opsera.com
Mon Jun 15 21:12:33 GMT 2009


On 12 Jun 2009, at 15:31, Stefan Washietl wrote:

> Kieren Diment wrote:
> >  sub quit : Local {
> >      exit 1;
> >  }
> >
>
> This is exactly what I tried and would be the prefered solution.
>
> Sorry if I only implicitely mentioned that I use the -fork option.  
> In that case it does not work, or more specifically, does not shut  
> down the server as I had expected.
>
> In fact nothing happens, I don't get any feedback in the debug  
> output and and I get an empty response from the server.

You've set the fork option. That means every request to the dev server  
is forked. So the exit statement means the forked process is finished.  
The main one, listening on port 3000, is still running.

It is possible to set a method to do a RESTART on the main process  
(see the C::E::HTTP.pm code), so I guess a new method of EXIT might do  
the trick here. You would want to limit which clients can send this  
method though.

Ton




More information about the Catalyst mailing list