I have damon in python which runs external program:
subprocess.call(["java", "-jar", "start.jar"])
when I kill daemon, the child process (java) is still running
how can I make so that child process is also killed ?
I have damon in python which runs external program:
subprocess.call(["java", "-jar", "start.jar"])
when I kill daemon, the child process (java) is still running
how can I make so that child process is also killed ?
Use
subprocess.Popen()
instead ofsubprocess.call()
. For example:To terminate the child:
To capture the kill signal, you could so something like this: