This question already has an answer here:
I am editing this question since it was marked duplicate as another question about how to kill a zombie process.
I am not looking for an answer to how to kill a zombie process. I do not have zombies on my system and I am aware of how zombies are created.
Let me try to re-phrase the question. Presently, these are the accepted methods of removing a zombie:
Sending SIGCHLD to the parent. Works theoretically, not always in practice since one of the reasons the zombie was created in the first place could be because the parent wasn't responding properly to SIGCHLD.
Killing the parent process.
- Fixing the bug in the program that created the Zombie.
Or as mentioned at here
Or for this reason mentioned by @richard in the comments to my question before this edit:
..to prevent the pid being reused. The parent has the pid of the child and may signal the child (may try to kill it), just from the pid it recieved when it created the child. It would be bad for the pid to be reused. Therefore the child remains in a zombie state until the parent acknowledges the death of the child, or the parent dies.
Now my questions are:
Why is that there is no straight-forward and direct method to clean up a zombie or zombies.
What would be the side-effects/consequences if zombie could've been killed with a signal.
What is stopping the *NIX maitainers to create a SIGNAL or a command (my apologies, if the phrase 'creating a new signal' is not technologically acceptable) that cleans up a zombie.