[Haskell-cafe] How to terminate the process group of a process created with createProcess?

Brandon Allbery allbery.b at gmail.com
Wed Jan 11 22:36:35 CET 2012


On Wed, Jan 11, 2012 at 16:26, André Scholz <andre.scholz at uni-bremen.de>wrote:

> (on unix) creating a process A which spawns itself a subprocess B and
> terminating process A before it finishes leaves process B as a process on
> its
> own. This is because "terminateProcess" sends the sigterm signal to the
> process only and not to its process group.
>

terminateProcess passes on the semantics of kill(2); on SVID-compliant (and
I think POSIX.1-compliant) systems, the negative of the process group
leader's process ID is used to signal the process group.  Note that you may
need to arrange for your initial child process to invoke setpgrp() to
insure that the parent program is not part of the process group.

However I'm unclear as to the situation you are encountering, as your
example does not appear to be spawning an intermediate process.

-- 
brandon s allbery                                      allbery.b at gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120111/0394cda5/attachment.htm>


More information about the Haskell-Cafe mailing list