[Twisted-Python] stopping a twistd daemon: SIGTERM or SIGKILL
justin.venus at gmail.com
Tue Jul 24 23:28:21 EDT 2012
I experienced a similar issue with a rather large twisted daemon. I ended
up installing my own signal handler and issued a triggerSystemEvent to stop
the twisted services. I can point you towards my code if you want to
pursue that route.
On Jul 24, 2012 10:21 PM, "Tom Sheffler" <tom.sheffler at gmail.com> wrote:
> Hi Twisted Folks,
> We use monit to start and stop our twistd daemons. I have set up monit to
> restart some of the daemons when they grow too large. I use the following
> /bin/bash -c 'kill -s SIGTERM `cat /var/run/sensrtunw/sensrtunw.pid`'
> Occasionally, this is unsuccessful in killing the twistd process, and I
> need to use a SIGKILL manually as a last resort.
> Any ideas why?
> I believe the SIGTERM method will do a clean shutdown, calling the
> appropriate stopService methods. This would be the preferred method.
> The only thing that comes to mind is that the process does have a very few
> threads ... I believe these are the database connections. Could there be a
> race condition that prevents twistd from stopping? Shall I simply use
> SIGKILL in all cases?
> Suggestions or comments appreciated.
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python