I need to execute and terminate / terminate various shell scripts from within Java (> = 1.5; ProcessBuilder). With standard java mechanisms, I can only kill the main process used to execute the shell script. When this shell script starts other processes (e.g.. / Foo.sh &; ./ bar.sh &), then the processes are still running when I terminate / terminate the main process of the shell script inside Java.
How can I keep track of all the IDs of all new child processes from Java? Is there any way to do this? Or is it possible (in * nix- and Win-OSes) to find all processes created by one known process?
Thank you Thomas
user226547
source
share