Gentoo Archives: gentoo-user

From: Jorge Almeida <jalmeida@××××××××××××.pt>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] kill a child and suicide
Date: Tue, 02 May 2006 13:55:33
Message-Id: Pine.LNX.4.64.0605021445320.17917@jmaa.math.ist.utl.pt
In Reply to: Re: [gentoo-user] [OT] kill a child and suicide by Etaoin Shrdlu
1 On Tue, 2 May 2006, Etaoin Shrdlu wrote:
2
3 >
4 > I think (untested) you can do something like
5 >
6 > trap 'kill <pid of child>' TERM
7 >
8 > at then beginning of parent.sh. This way, when the parent recives TERM it
9 > in turn sends a TERM to the child. If you want the parent to terminate,
10 > add the exit command as well:
11 >
12 > trap 'kill <pid of child>; exit 1' TERM
13 >
14 But how to find out the PID of child? What would be convenient is a way
15 to send signals "recursively" to a process and its children.
16 Maybe I'm trying to solve a problem with wrong tools...
17 Thanks,
18
19 Jorge Almeida
20 --
21 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] [OT] kill a child and suicide "Vladimir G. Ivanovic" <vgivanovic@×××××××.net>
Re: [gentoo-user] [OT] kill a child and suicide Zac Slade <krakrjak@××××××××××.net>