Gentoo Archives: gentoo-user

From: "Vladimir G. Ivanovic" <vgivanovic@×××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] kill a child and suicide
Date: Tue, 02 May 2006 15:42:48
Message-Id: 1146584059.13211.3.camel@scarlatti
In Reply to: Re: [gentoo-user] [OT] kill a child and suicide by Jorge Almeida
1 pkill has a -g option to send a signal to a process group.
2
3 --- Vladimir
4
5 On Tue, 2006-05-02 at 14:48 +0100, Jorge Almeida wrote:
6 > On Tue, 2 May 2006, Etaoin Shrdlu wrote:
7 >
8 > >
9 > > I think (untested) you can do something like
10 > >
11 > > trap 'kill <pid of child>' TERM
12 > >
13 > > at then beginning of parent.sh. This way, when the parent recives TERM it
14 > > in turn sends a TERM to the child. If you want the parent to terminate,
15 > > add the exit command as well:
16 > >
17 > > trap 'kill <pid of child>; exit 1' TERM
18 > >
19 > But how to find out the PID of child? What would be convenient is a way
20 > to send signals "recursively" to a process and its children.
21 > Maybe I'm trying to solve a problem with wrong tools...
22 > Thanks,
23 >
24 > Jorge Almeida
25
26 Vladimir G. Ivanovic
27 Palo Alto, CA 94306
28 +1 650 678 8014
29
30 --
31 gentoo-user@g.o mailing list