Why child process still alive after parent process was killed in Linux?

No, when you kill a process alone, it will not kill the children.

You have to send the signal to the process group if you want all processes for a given group to receive the signal

For example, if your parent process id has the code 1234, you will have to specify the parentpid adding the symbol minus followed by your parent process id:

kill -9 -1234

Otherwise, orphans will be linked to init, as shown by your third screenshot (PPID of the child has become 1).

Leave a Comment