[issue5672] Implement a way to change the python process name
report at bugs.python.org
Mon Dec 7 02:14:01 CET 2009
Daniele Varrazzo <piro at develer.com> added the comment:
> It seems that some utilities and programs (killall,
> gnome-system-monitor, and so on) looks for the process name in
> /proc/PID/status, not in /proc/PID/cmdline, so it should be better
> (in Linux), to modify both, /proc/PID/cmdline (changing argv) *and*
> /proc/PID/status (calling prctl()).
> I installed py-setproctitle, and can't kill it with killall once I
> set the name to "hello", for example. :-(
Just released setproctitle 0.2 where I also call prctl() if available.
It is actually the string used by killall.
>> For what I observed, clobbering argv changes what shown in
>> ``/proc/PID/cmdline``, whereas prctl changes what can be read in
>> ``/proc/PID/status`` (and ``stat`` too). ``ps`` uses the former,
>> switches to the latter when calling ``ps a`` and ``ps f``. ``top``
>> toggles between the two pressing ``c``.
> Sorry, but here (Ubuntu 9.10) it works the other way around: "ps"
> lists the /proc/PID/status -> name field and "ps a" lists the
> /proc/PID/cmdline. But I got the explanation. :-)
Yup, sorry: it was the other way round :P
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list