changing process name

Adam Tauno Williams awilliam at whitemice.org
Sun Dec 30 10:53:31 EST 2012


On Mon, 2012-11-19 at 10:39 +0000, andrea crotti wrote:
> I have very long processes to spawn which I want to lauch as separate
> processes (and communicate with ZeroMQ), but now the problem is that the
> forked process appears in "ps" with the same name as the launcher
> process.
> This is a simplified version of what I'm trying to do:
> def long_sleep():
>     sys.argv[:] = [sys.argv[0]] + ['daemon', 'arguments']
>     time.sleep(20)
> so both the sys.argv reassignment don't work so far, any other way to
> fix this?
> On the real machine I also get zombie processes, but on my machine I
> can't reproduce this, and would also be nice to fix that..


The Python module "procname" allows you change the process name so you
can see it in ps, top, etc...




More information about the Python-list mailing list