Stopping an application (punjab) that is run using Twisted

python, twisted

Solution

A server started with `twistd` is stopped in the somewhat typical UNIX fashion: send it a signal - INT is a good first choice:

kill -INT 3726

This should initiate shutdown. You can check in the log file, generally `twistd.log` in the same directory as you started the server.

Since the PID of the running process is tracked in `twistd.pid` (again, same directory), you can also grab that information directly from the file instead of having to type (and perhaps mistype) it:

kill -INT `cat twistd.pid`

Problem

I am trying to run punjab connection manager with very less python knowledge. I followed the punjab docs and can start the application. But how do I stop/restart it ? ``` twistd -y punjab.tac ``` starts punjab first time but after that if I enter the same command , it says ``` Another twistd server is running, PID 3726. ``` Precisely I want to set the host and port options for punjab using the command line and restart it again. Please help. Thanks

Original source