Interview Prep/Linux/Processes, Signals & systemd

What is a zombie process, and how do you get rid of it?

IntermediateConceptProcesses, Signals & systemd
Answer

A zombie (Z state, <defunct>) has exited but its parent has not called wait() to read its exit status. It uses no CPU or memory, only a PID table slot. You cannot kill a zombie; you fix or kill the parent, after which init adopts and reaps it.

ps -eo pid,ppid,stat,cmd | awk '$3 ~ /Z/'

Thousands of zombies can exhaust pid_max.

All Linux questions Roadmap: Linux

More on Processes, Signals & systemd