开发者

how to specify the name of my daemon process using pydaemon

I'm using pydaemon ( http://www.python.org/dev/peps/pep-3143/ ) to make a friendly daemon. How do I give it a name? by default it's called 'python' but I wa开发者_运维百科nt something more meaningful.


Changing the process name cannot be done from plain Python, and pydaemon is 100% Python. You need a C-level library like py-setproctitle to do that. Then, simply add the following to your main method:

try:
  import setproctitle
  setproctitle.setproctitle('my-awesome-program')
except:
  pass # Ignore errors, since this is only cosmetic
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜