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
精彩评论