pkill has a -g option to send a signal to a process group.

--- Vladimir

On Tue, 2006-05-02 at 14:48 +0100, Jorge Almeida wrote:
> On Tue, 2 May 2006, Etaoin Shrdlu wrote:
> 
> >
> > I think (untested) you can do something like
> >
> > trap 'kill <pid of child>' TERM
> >
> > at then beginning of parent.sh. This way, when the parent recives TERM it
> > in turn sends a TERM to the child. If you want the parent to terminate,
> > add the exit command as well:
> >
> > trap 'kill <pid of child>; exit 1' TERM
> >
> But how to find out the PID of child? What would be convenient is a way
> to send signals "recursively" to a process and its children.
> Maybe I'm trying to solve a problem with wrong tools...
> Thanks,
> 
> Jorge Almeida

Vladimir G. Ivanovic
Palo Alto, CA 94306
+1 650 678 8014

-- 
gentoo-user@gentoo.org mailing list

Reply via email to