Saturday, March 24, 2007

Setting "process name" with twistd

Little known twistd feature:


exarkun@boson:~$ cat foo.tac
from twisted.application.service import Application, IProcess

application = Application("Demonstrate twistd process name support")
IProcess(application).processName = "name-demo"
exarkun@boson:~$ twistd -y foo.tac
exarkun@boson:~$ pidof name-demo
11097
exarkun@boson:~$

3 comments:

  1. Can this be set at any moment during runtime too ( I suppose so)?
    Can one set full proctitle (so it doesn't have the nasty looking arguments to it?)

    ReplyDelete
  2. On some platforms that's possible, but twistd doesn't support this now, since it's a bit more complex than setting it up front. Adding support for that when proctitle (and a wrapper) are available might be a good idea, though.

    ReplyDelete
  3. is it possible to hide the arguments too? (still shown: "foobar /usr/bin/twistd --originalname -y foobar.tac") anyway, thank you very much for this.

    brubelsabs

    ReplyDelete