[Linux-disciples] perl parent vs. child vs. process group --
killing
Adam Rosi-Kessel
adam at rosi-kessel.org
Wed Aug 11 13:45:27 EDT 2004
On Tue, Aug 10, 2004 at 02:15:30PM -0400, Dylan Thurston wrote:
> On Tue, Aug 10, 2004 at 10:14:53AM -0400, Adam Rosi-Kessel wrote:
> > The above code no longer works; apparently the process group is connected
> > to the parent and not the child. killing getppid() doesn't work in this
> > case, though, because the $SIG{HUP} = 'IGNORE' doesn't apply to the
> > parent.
> Can you set the process group ID? There's a handy system call setpgid
> which is presumably what the shell at an interactive prompt does for
> you.
This doesn't seem to do it either.
Really what would help is if there were a way to find out what children a
child has spawned so they can all be killed. If I kill the pid of the
child and pid+1 in my perl script, that does the job, but that assumes
that the child only has one child and that the grandchild's pid is pid+1,
which I don't think is a safe assumption to make.
--
Adam Kessel
http://adam.rosi-kessel.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20040811/20171843/attachment.pgp
More information about the Linux-disciples
mailing list