<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Jul 24, 2018 at 10:05 AM PICCA Frederic-Emmanuel <<a href="mailto:frederic-emmanuel.picca@synchrotron-soleil.fr">frederic-emmanuel.picca@synchrotron-soleil.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello<br>
<br>
I have done the first solution and call the program changing the command line in oder to execute each child task.<br>
It works well and I can change the uid gid of these process.<br>
<br>
> For the most part, yes. You may need to reach deeper and use SIGKILL occasionally, depending on how stubborn the child process is. The `timeout` will only kill off the parent thread's call to block on the child's exit code.<br>
<br>
Since all these tasks are executing also child process via other system cals.<br>
So I have a hyerarchy of process.<br>
<br>
Do you know how to manage that sort of things if something goes wrong and I need to kill the first child and all its children's ?<br>
Is it possible for CreateProcess to track all these process and kill them all  on request ?<br>
<br></blockquote><div><br></div><div>Funnily enough, there's another discussion going on about this right now:</div><div><br></div><div><a href="https://mail.haskell.org/pipermail/haskell-cafe/2018-July/129646.html">https://mail.haskell.org/pipermail/haskell-cafe/2018-July/129646.html</a><br></div><div><br></div><div>The basic answer is:</div><div><br></div><div>* You can create a process group and then kill the whole process group</div><div>* But a misbehaving program would still be able to escape it by creating its own process group, only something like cgroups can be fully reliable here</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> Yes, you should avoid forkProcess in this case, it will have unpredictable and confusing results.<br>
<br>
I take you advices seriously and now I start to build something (I hope) more robust.<br>
<br>
Thansk<br>
<br>
Frédéric<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote></div></div>