java - Track process-ids of sub-/child-processes? -


I need to execute and revoke / cancel different shell scripts from inside Java (> = 1.5; ProcessBuilder) With Java mechanisms I am able to kill the main process used only for shell script execution. When this shell script starts other processes (for example ./foo.sh & ./bar.sh &) then the processes are still going on when I terminate / abort the main shell script process in Java I am

How can I track all IDs from within Java with all the new sub / child processes? Is there any positive way to do this? Or is it possible to find all the processes produced by a known process (* in Nix- and Win-OS)?

Thank you, Thomas

If you have control over different scripts, Children can pass PID (Use $ to find PID of last run background process) Back to main Java program.

Otherwise ,.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -