Gemini on Question 13, Sep 22
How do I kill a zombie process in Linux that won't respond to SIGTERM?The short answer is: You cannot kill a zombie process directly because it is already dead.
That is why it won't respond to SIGTERM (kill -15) or even SIGKILL (kill -9). A zombie process (state Z) is just a leftover entry in the process table. It has finished executing, its memory has been freed, but it is waiting for its parent process to read its exit status.
To get rid of a zombie, you have to deal with its parent. Here is the step-by-step guide to clearing it:
Step 1: Find the Parent Process ID (PPID)
You need to identify which process created the zombie. Run the following command (replace <zombie_PID> with the PID of your zombie):
ps -o pid,ppid,stat,comm -p <zombie_PID>
If you don't know the zombie's PID, you can list all zombies and their parents:
ps axo pid,ppid,stat,comm | awk '$3=="Z"'
Look at the PPID (Parent Process ID) column.
Step 2: Nudge the Parent Process (Safe Method)
Sometimes, the parent process is just hanging or forgot to run the wait() system call. You can explicitly tell the parent that its child has died by sending it a SIGCHLD signal.
kill -s SIGCHLD <PPID>
Wait a few seconds and check if the zombie is gone. If it is, great! If not, proceed to Step 3.
Step 3: Kill the Parent Process (Aggressive Method)
If the parent process is poorly programmed or frozen, it will never read the exit status. The only way to remove the zombie is to kill the parent process.
Warning: Ensure the parent process is not a vital service that will crash your system or lose unsaved work if killed.
Send a normal kill signal to the parent:
kill <PPID>
If the parent also refuses to die, force-kill the parent:
kill -9 <PPID>
Why does killing the parent work?
When you kill the parent process, the zombie process becomes an "orphan." In Linux, all orphan processes are automatically adopted by the init system (usually systemd, which is PID 1). The init process routinely performs the wait() system call specifically to clean up orphaned zombies. The zombie will disappear instantly.
A Common Mix-up: Is it actually in "D" state?
People often confuse Zombie processes (State Z) with Uninterruptible Sleep processes (State D).
If you run top or ps and the process has a D next to it, it is not a zombie. It is alive, but it is stuck waiting on hardware/I/O (usually a failing hard drive or a disconnected network share).
- •
Dstate processes will also ignoreSIGTERMandSIGKILL. - •You cannot kill a
Dstate process. You either have to fix the hardware/network issue it is waiting on, or reboot the machine.
Exact recordShowHideThe model id, the run, the verbatim text with line numbers and its full sha256
- Scored
- answered
- Received
- 2026-09-22 09:06:12 UTC
- Run
- 20260922T090022Z-7ff13b
- Served by
- Google AI Studio · HTTP 200 · finish stop
- Size
- 2,696 characters · 2,020 tokens out incl. hidden reasoning · 29.5 s
End of response · 49 lines · 2,696 characters · sha256 69bb6e49919925788c2149ce3d31158956aa8161bf85ab3b98e395835d2f29c4