Re: recursively kill the childs of a process
- From: Barry Margolin <barmar@xxxxxxxxxxxx>
- Date: Wed, 11 Jan 2006 23:22:32 -0500
In article <slrndsai3t.4t2.stephane.chazelas@xxxxxxxxxxxxxxx>,
Stephane CHAZELAS <this.address@xxxxxxxxxx> wrote:
> 2006-01-10, 17:03(-06), joe@xxxxxxxxxxxxxxx:
> > "Atropo" <lxvasquez@xxxxxxxxx> writes:
> >
> >> Posted before but no one answers.
> >> 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 have not died yet.. all i need is kill
> >> the childs of the old one process.
> >>
> >> $ ps -fea|grep "Process"|grep -v grep
> >>
> >> it gives me the two main process. like this
> >> pid ppid
> >> user 96218 1 0 06:15:05 - 0:20 MainProcess
> >> user 53214 1 0 Jan 10 - 1:15 MainProcess
> >>
> >> after this how can i search for every process who parent process id is
> >> 53214 to kill it ??
> >
> > Just send a signal to the process group, which is the parent process'
> > pid
>
> Well, you may see that you are killing more processes than you
> want if the process you want the children to be killed is not
> the leader of the process group.
If it's not a process group leader, then you won't kill any processes,
because the negative of its PID won't be a valid PGID. So you'll either
kill the processes you intend or you'll kill nothing.
--
Barry Margolin, barmar@xxxxxxxxxxxx
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
.
- Follow-Ups:
- Re: recursively kill the childs of a process
- From: Stephane CHAZELAS
- Re: recursively kill the childs of a process
- References:
- recursively kill the childs of a process
- From: Atropo
- Re: recursively kill the childs of a process
- From: joe
- Re: recursively kill the childs of a process
- From: Stephane CHAZELAS
- recursively kill the childs of a process
- Prev by Date: Re: XML parser for RSS schema Scipt
- Next by Date: Re: recursively kill the childs of a process
- Previous by thread: Re: recursively kill the childs of a process
- Next by thread: Re: recursively kill the childs of a process
- Index(es):
Relevant Pages
|