I have a few long term processes and temporary processes in Python. While shell and C programs run under their own names, all Python processes run as ‘python filename.py’, which makes it tough to identify processes.
How can I make python processes show up as ‘logserver.py’ or such in Linux? I use Python 2.7 in Ubuntu 11.10.
Add a shebang to the Python file in question, make the Python file executable (e.g. by
chmod a+x ./logserver.py) and start it directly by./logserver.py.A shebang is a line telling the kernel which interpreter to use. It’s simply a line like
#!/usr/bin/env pythonat the very beginning of the file.