Gemini on Question 13, Sep 28
How do I kill a zombie process in Linux that won't respond to SIGTERM?The reason the zombie process won't respond to SIGTERM (or even SIGKILL / kill -9) is because a zombie process is already dead.
In Linux, a "zombie" (or defunct process) is a process that has completed execution, but still has an entry in the process table. This happens because its parent process hasn't read its exit status yet.
Because the zombie is already dead, you cannot kill it. To get rid of a zombie process, you have to deal with its parent process.
Here is how to find and clear a zombie process:
Step 1: Find the Parent Process ID (PPID)
You need to find out which process spawned the zombie. Run the following command, replacing <zombie_PID> with the Process ID of your zombie:
ps -o ppid= -p <zombie_PID>
This will output a single number. That number is the Parent Process ID (PPID).
(Alternatively, you can use pstree -p -s <zombie_PID> to see a visual tree of the process and its parent).
Step 2: Ask the parent to reap the zombie
Sometimes, the parent process is just hanging or forgot to handle its child. You can send a SIGCHLD signal to the parent. This signal essentially tells the parent, "Hey, your child died, please acknowledge it."
kill -s SIGCHLD <PPID>
Check if the zombie is gone. If it is, you are done.
Step 3: Kill the Parent Process (If Step 2 fails)
If the parent process is completely unresponsive or poorly programmed, it will never reap the zombie. Your only option is to kill the parent process.
You can try a polite kill on the parent first:
kill -15 <PPID>
If the parent refuses to die, force kill the parent:
kill -9 <PPID>
What happens after you kill the parent?
When you kill the parent process, the zombie process becomes an "orphan." In Linux, orphaned processes are immediately adopted by the system's init or systemd process (PID 1).
PID 1 is specifically programmed to automatically read the exit status of its children. As soon as PID 1 adopts the zombie, it will instantly "reap" it, and the zombie will disappear from your process table.
⚠️ Important Warning: Before killing the Parent Process (PPID), check what it is by running ps -p <PPID>. If the parent process is a vital system service or PID 1, do not kill it, as it will crash your system. If a vital service is spawning zombies, the safest way to clear them is to reboot the machine.
Exact recordShowHideThe model id, the run, the verbatim text with line numbers and its full sha256
- Scored
- answered
- Received
- 2026-09-28 09:05:29 UTC
- Run
- 20260928T090007Z-07d4be
- Served by
- Google · HTTP 200 · finish stop
- Size
- 2,426 characters · 1,587 tokens out incl. hidden reasoning · 14.9 s
End of response · 46 lines · 2,426 characters · sha256 4d7937aac47dae7c6d26ce8c8bb5c86411fefa4010c05a75d35e584817c6ba08