So I have a script which creates a child process with the Subprocess module.This child process then also creates child processes and it can go on for a while. Is there any way to kill the entire chain of parent processes from a child process without knowing how deep in the chain it is?
i tried:
os.kill(os.getppid(), signal.SIGTERM)
but that only kills the direct parent of the child process. Id like to go all the way to the top of the chain and kill the processes coming down.