tags:

views:

181

answers:

1

Is there a way to change the name of a process running a python script on Linux?

When I do a ps, all I get are "python" process names.

+6  A: 

http://code.google.com/p/procname/

Sample usage:

# Lets rename:    
>>> procname.setprocname('My super name')    

# Lets check. Press Ctrl+Z       
user@comp:~/procname$ ps

    PID TTY TIME CMD 

13016 pts/2 00:00:00 bash

13128 pts/2 00:00:00 My super name <-- it's here
Adam Bernier
Neat! Is there a way to perform the same operation **without** incurring the additional complexity of a `C` extension?
jldupont
http://bugs.python.org/issue5672 makes me think that, no, there isn't :-(
Adam Bernier
in that ticket, they also mention another process name-changing tool (also in C): http://code.google.com/p/py-setproctitle/source/browse/tools/
Adam Bernier
+1: great stuff! Thanks!
jldupont