Terminate child processes spawned by a ProcessBuilder on *nix
<p>I'm executing a shell pipeline from a java program - it'll be something like</p>

<pre><code>ProcessBuilder builder = new ProcessBuilder(
                         "sh", "-c", "program1 | program2 | program3");
builder.start();
</code></pre>

<p>In some cases this unit might need to be terminated. However</p>

<pre><code>process.destroy();
</code></pre>

<p>Will only destroy the "sh" command. The commands in the pipline will be orphaned and adopted by the init process.</p>

<p>Is there any way to easily terminate all these child processes - or execute a pipeline like the above in a way that makes it easier to terminate them . Altering progam 1/2/3 can't be done. Portability beyond linux is not a issue.</p>
