[Twisted-Python] spawnProcess and kill the child process.

holsety huang hoooooosety at gmail.com
Tue Nov 27 09:04:13 EST 2012

hi, all

I start a process using spawnProcess and want to kill when my certain
Factory stops.

something I wrote like these


p = SomeProtocol(ProcessProtocol)

reactor.spawnProcess(p, 'twistd', ['twistd', '-y', 'anotherMain.py'], {})


class Factory(ServerFactory):

def StopFactory(self):
 # which is the p above

I thought the subprocess will be killed which is not.

I tried using p.transport.signalProcess("KILL") some other place, and it

What's wrong with my code? Thanks!

P.S, which is the best way to shut down a twistd, I send the TERM to it
now. It just work fine.

Regards, Huang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20121127/79d196da/attachment.htm 

More information about the Twisted-Python mailing list