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.

Real-world scenario: Writing your own zombie

Real-world scenario: Writing your own zombie

- All right, it's a real-world scenario for this lesson. We are obviously going to compile some stuff. This is about how you can run your own zombie. You've learned about zombies before. So a zombie process occurs when a child process finishes execution, but the parent process doesn't wait for it to terminate. And as a result, the child termination status is uncollected. And in the Git repository, you will find a zombie.c file. And you can compile it using gcc zombie.c -o zombie, and run it with the ./zombie command. And then, as this source code is actually running the zombie for 10 seconds, you will have 10 seconds to verify that the zombie is present. Let me show you. So here we have the zombie.c, and in a zombie.c, we see the include of all the generic functions. Then we have the main code, and in main code, we are going to run the zombie. So this part is what is actually running the zombie. So, what is it doing? Well, it'll have the process sleep for, oh, look at that, I already…

Contents