On 10/18/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I started a process with 'python2.4 start.py' and when I do
ps -ef I can see the name of process as 'python2.4 start.py'.
How kill this process w/o knowing the process id?
Must I write the pid to a file in /var/run to kill this later
in a script?
(I don't want to kill it with 'killall python2.4' cuz that might
kill many other python related processes!)
Start with something (untried) like
$ ps -eo pid,cmd | gawk '/start.py/{print $1; exit}'
Basic idea is to use some restrictive options on ps(1) so it only
gives you the PID and the comand with arguments, then select the PID
column of the pertinent line. Use this output as input to the kill
command of your choice. e.g.
$ kill -HUP $( ps -eo pid,cmd | gawk '/start.py/{print $1; exit}' )
carl
--
carl lowenstein marine physical lab u.c. san diego
[EMAIL PROTECTED]
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list