If the process is not thought to be hostile, I imagine it's best to first try signaling only the parent, and only signal the group if necessary. Otherwise, you may prevent it from cleaning up after itself properly. Dunno how to wait for the group to die.

On Tue, Jul 24, 2018, 3:21 PM Bardur Arantsson <spam@scientician.net> wrote:
On 2018-07-24 15:42, Johannes Waldmann wrote:
> Dear Cafe,
>
> I am using
> https://hackage.haskell.org/package/process-1.6.4.0/docs/System-Process.html#v:readProcess
> to start an external command, and wait for its completion.
>

If the process is hostile (e.g. fork bomb + countermeasures), then the
*only* realiable way to do this is to use cgroups.

Obviously, this applies to Linux only. I'm not sure there's actually any
truly POSIX way to reliably kill hostile sub-processes. I don't think
so. (The progress group thing doesn't work if the process is hostile.
It'll work fine otherwise.)

Regards,

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.