[Haskell-cafe] how to terminate a (Posix) process and all its subprocesses?

Johannes Waldmann johannes.waldmann at htwk-leipzig.de
Tue Jul 24 13:42:32 UTC 2018

Dear Cafe,

I am using
to start an external command, and wait for its completion.

Now I would like to time-out this after a while.
I can use
and this works in simple cases -

but not in case the external command has spawned child processes.
(cleanupProcess sends SIGTERM but only to the process at the top of
the tree ?)

I guess I need to use
but that seems rather low-level - and I don't see how I would
get the ProcessID of the process started by  readProcess,
so I'd also have to re-do that.

Is there an abstraction/library that would help here?

Thanks - J.W.

More information about the Haskell-Cafe mailing list