Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #35805

Re: changing process name

Subject Re: changing process name
From Adam Tauno Williams <awilliam@whitemice.org>
Date 2012-12-30 10:53 -0500
References <CAF_E5JZiMuQ+4vVFUOHA4mbkmG_mbq+PHsNLVbhJWPJ2e_yUeg@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1466.1356884245.29569.python-list@python.org> (permalink)

Show all headers | View raw


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...

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: changing process name Adam Tauno Williams <awilliam@whitemice.org> - 2012-12-30 10:53 -0500

csiph-web