Re: NEWBIE: how to find and kill by Parent PID
- From: Loki Harfagr <loki@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 30 Dec 2005 19:07:22 +0100
Le Fri, 30 Dec 2005 11:32:12 -0600, Ed Morton a écrit :
> Atropo wrote:
>> Here is the issue:
>> there is a process that must be shutdown for maintenance purpose every
>> morning at 5:00 am.
>> usually it spawn several childs.., sometimes some of this childs
>> don't die so the parent process either.. when the aplication starts up
>> again it raises a new parent process but in confict with the old one
>> that has'nt died yet.. all i need is kill the childs of the old one
>> and everything fine..
>>
>> I thought something like
>> first :-- $ ps -fea|grep "process"|grep -v grep|awk '{$3 == "\ 1"}
>> {print $2,$3}'
>> it gives me the two main process. like this
>> 75555 1 --> the new one
>> 96666 1 --> the old one.
>>
>> after this how can i look for every process who parent process id is
>> 75555 to kill it ??
>>
>
> This is a shell question, not an awk language one, so I'm cross-posting
> and setting followups for comp.unix.shell.
>
> Ed.
A quick answer, not foolproof but fast, in case your problem
is urgent, could be:
# ps -ef |grep [7]5555 | awk '$3 ~ /75555/{print $2}'
.
- Follow-Ups:
- Re: NEWBIE: how to find and kill by Parent PID
- From: Atropo
- Re: NEWBIE: how to find and kill by Parent PID
- Prev by Date: Re: What's the meaning of $- (minus sign, not underscore)
- Next by Date: Re: NEWBIE: how to find and kill by Parent PID
- Previous by thread: What's the meaning of $- (minus sign, not underscore)
- Next by thread: Re: NEWBIE: how to find and kill by Parent PID
- Index(es):