Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

zombie process can't be killed

Is there a way to kill a zombie process? I've tried calling exit to kill the process and even sending SIGINT signal to the process, but it seems that nothing can kill it. I'm programming for Linux.

like image 640
user12707 Avatar asked Jun 13 '11 20:06

user12707


People also ask

Can you kill a zombie process?

Additionally, you can also kill the zombie process by sending the SIGCHLD signal to the parent process to make the parent process exit cleanly with its zombie process.

Is zombie and Cannot be killed?

Zombie processes are already dead, so they cannot be killed, they can only be reaped, which has to be done by their parent process via wait*() . This is usually called the child reaper idiom, in the signal handler for SIGCHLD : while (wait*(...

How can we stop the process of becoming a zombie?

By ignoring the 'SIGCHLD' signal: When a child is terminated, a corresponding SIGCHLD signal is delivered to the parent, if we call the 'signal(SIGCHLD,SIG_IGN)', then the SIGCHLD signal is ignored by the system, and the child process entry is deleted from the process table Thus, no zombie is created.

What will kill a zombie?

Nearly all zombie survivalists are in agreement that the destruction of the brain is the only surefire way to neutralize the zombie (though a few rare types of zombies require complete dismemberment).


1 Answers

Zombie processes are already dead, so they cannot be killed, they can only be reaped, which has to be done by their parent process via wait*(). This is usually called the child reaper idiom, in the signal handler for SIGCHLD:

while (wait*(... WNOHANG ...)) {
    ...
}
like image 181
ninjalj Avatar answered Sep 19 '22 14:09

ninjalj