For example: We have a process P1 which invokes another process (i.e. script) P2, now P2(script) invokes another process (i.e. script) P3 and now P3 invoke P4. So, if there is an abnormal termination of P1, how can we terminate P2, P3 and P4.
P1 is aware of pid of P2 because P1 invoke P2 via vfork() and then execvpe(). But P1 is not aware about the pid of P3 and P4.
Please suggest how can I kill P2, P3 and P4.