I need to kill a process and all of its subprocesses programatically.
Killing the group is not an option because I do not want to kill the parent processes.
Example:
pid process
1 nice parent process that should live
2 subprocess of 1, but a nice one, should live
3 subprocess of 1, evil one, should die
4 childprocess of 3, inherite evil, should die
5 childprocess of 3, inherite evil, should die
6 childprocess of 5, inherite evil second line, should die
kill --some-cool-option 3