[Twisted-Python] stopping daemon started via twistd

Kevin Horn kevin.horn at gmail.com
Tue Jul 1 18:26:13 EDT 2008

I don't know of a portable way to do this, but...

The "stopService" method that you referenced is probably not what you want.

It stops a twisted service object, which you should have created in your
.tac file, but does not stop twistd.

I know diddly about how to stop and start service/daemon processes on MacOS,
but on Win32, you have a lot of options:
- rewrite things to use pywin32's services support...this typically involves
starting the reactor manually, though
- there's some code in the twisted svn sandbox (look under moonfallen) that
does something like this using py2exe (haven't used this though)
- take your twistd command line and use "instsrv" and "srvany" to make it
run as a service (maybe)

Good luck!

Kevin Horn

On Tue, Jul 1, 2008 at 4:53 PM, Jeff Dyke <jeff.dyke at gmail.com> wrote:

> I'm looking for a portable way to stop and start a twisted
> application, specifically a  twisted.web.xmlrpc server being started
> with a .tac file via twistd.  on ubuntu i can easily use the
> start-stop-daemon but some other developers are using mac/windows and
> i was looking for a nice way for all to be able to start and stop this
> server as they make changes to it, aside from kill/killproc that is.
> I noticed that the object returned after calling internet.SSLServer
> server has a method called stopService, but am confused about how to
> use that, after starting it with twistd.  Perhaps twistd is not the
> right approach for starting?  googling around seems to bring up
> arguments from years past about if this behavior belongs in twisted on
> in the users app, but found no real solution...but may have missed the
> obvious.
> Thanks
> Jeff
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20080701/47bd620e/attachment.htm 

More information about the Twisted-Python mailing list