Reputation: 187
I have a few doubts on process termination. My use case is such that
Does process.destroy() in java also kill the process x along with shell script?
What happens when the Java process is killed while x is running? Is both shell script process and process x killed?
Upvotes: 2
Views: 382
Reputation: 26926
There is no tie between a child process and its parent.
Both process can know each other ids, but there is not a hard link between them.
Generally what happens to children of a process when it is killed is platform dependent, so there is not guarantee that when you kill a process created from java also the children of that process will be killed too. Additionally you program can have different behaviour on different operating systems.
Upvotes: 3