From the course: Exploring Linux Internals: Advanced Insights and Practical Applications

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Killing a zombie

Killing a zombie

- So in process management, you will occasionally encounter a zombie. Did you ever wonder how to kill a zombie? Well, let's talk about it. In order to kill a zombie, you need to understand how processes are stopped. So processes can voluntarily stop. And when that happens, they use the exit() system call. Also, a process can involuntarily be stopped when it receives a signal, and signals can be sent by other users, other processes, or the Linux kernel itself. Now when a process is stopped, it issues the exit() system call. And next the Linux kernel notifies the process parent by sending the SIGCHLD signal. Upon receiving the SIGCHLD signal, the parent process executes the wait() system call to read the status of the child process as well as the exit code. And while using wait(), the parent also removes the entry of the child process from the process table. And then if all of that has happened correctly, the process is gone. Let me make a quick drawing so that we can see how that…

Contents