patch to add a pid file to djabberd

Martin Atkins mart at degeneration.co.uk
Wed Nov 8 20:17:15 UTC 2006


Michael Scherer wrote:
> 
> In fact, as it create the PidFile before forking, this doesn't work as
> expected.
> 
> So we could simply use a configuration file directive, and then create
> the pid file after the daemonisation ( as in the proposed patch )  ?
> 

I've checked in your patch, with a minor alteration to die with logging 
if the pidfile can't be written.

http://code.sixapart.com/cgi-bin/viewcvs.cgi?rev=729&view=rev

However, I don't know of any way to make the Danga::Socket event loop 
terminate and return, and the code to clean up the pidfile doesn't run 
when the server dies in response to a TERM signal. Perhaps an END block 
would do the trick? I can't remember if END blocks still run if the 
process catches SIGTERM.



More information about the Djabberd mailing list