1. 11
  1. 2

    Killing a process group is the most portable solution. But it’s only reliable if you can guarantee that no descendants starts a new process group.

    On Linux the most reliable way is to create a cgroup and add the parent PID to it. Once part of the group, all the new processes of the parent will automatically be tracked by that cgroup.