MODELDRIFT.WATCH

Question 13 · Sep 14 · Day 5

Gemini on Question 13, Sep 14

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 is a process that has finished executing, but its parent process hasn't read its exit status yet. Because it is already dead, you cannot kill it directly.

To get rid of a zombie, you have to target its parent process. Here is the step-by-step way to do it:

Step 1: Find the Parent Process ID (PPID)

First, you need to find out which process spawned the zombie. Run this command, replacing <ZOMBIE_PID> with the ID of your zombie process:

ps -o pid,ppid,state,cmd -p <ZOMBIE_PID>

Look at the PPID column. That is the Parent Process ID.

(If you don't know the zombie's PID, you can list all zombies and their parents using: ps -A -ostat,pid,ppid,cmd | grep -e '^[Zz]')

Step 2: Notify the parent (The polite way)

Sometimes, the parent process just needs a reminder to clean up its dead children. You can send a SIGCHLD signal to the parent process. This tells the parent, "One of your children died, please collect its exit status."

kill -s SIGCHLD <PPID>

Check if the zombie is gone. If it is, you are done.

Step 3: Kill the parent (The forceful way)

If the parent process is poorly written or completely frozen, it will ignore the SIGCHLD signal. In this case, your only option is to kill the parent process.

When a parent process dies, all of its children (including zombies) are adopted by init or systemd (PID 1), which automatically cleans up zombie processes.

⚠️ WARNING: Before you do this, check what the parent process is. If it's a critical service (like a database or a web server), killing it will take that service offline. Never try to kill PID 1.

If it is safe to kill the parent, try asking it to close gracefully first:

kill -15 <PPID>

If the parent doesn't respond, force kill the parent:

kill -9 <PPID>

Once the parent dies, the zombie process will immediately disappear from your process table.

What if the Parent is PID 1?

If you look at the PPID in Step 1 and it is 1 (systemd or init), it means the system's main process has adopted it but is failing to reap it. This is incredibly rare and usually indicates a bug in the kernel or a process stuck in un-interruptible hardware sleep (often caused by a failing hard drive or bad network mount). In this scenario, the only way to clear the zombie is to reboot the server.

sha256 82220d6bf8e0… · 18 tokens in · 1,659 out · 15.5 s · via Google · stopped on its own

Sep 14, the whole dayQuestion 13, every day

Exact recordShowHideThe model id, the run, the verbatim text with line numbers and its full sha256
Model
google/gemini-3.1-pro-preview
pinned google/gemini-3.1-pro-preview-20260219; alias resolved to google/gemini-3.1-pro-preview-20260219 at 2026-09-14 09:00:21 UTC (matches the pin)
Date
2026-09-14 · run 20260914T090022Z-e98262 · scorer v1
Scored
answered
sha256
82220d6bf8e0a6f2f036e116c1f8fcaf335fb4e2069faa5ea8d8982d56753a02
Permalink
https://modeldrift.watch/r/2026-09-14/R1/google/gemini-3.1-pro-preview/
Scored
answered
Received
2026-09-14 09:06:06 UTC
Run
20260914T090022Z-e98262
Served by
Google · HTTP 200 · finish stop
Size
2,514 characters · 1,659 tokens out incl. hidden reasoning · 15.5 s
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 is a process that has finished executing, but its parent process hasn't read its exit status yet. Because it is already dead, you cannot kill it directly.
To get rid of a zombie, you have to target its **parent process**. Here is the step-by-step way to do it:
### Step 1: Find the Parent Process ID (PPID)
First, you need to find out which process spawned the zombie. Run this command, replacing `<ZOMBIE_PID>` with the ID of your zombie process:
```bash
ps -o pid,ppid,state,cmd -p <ZOMBIE_PID>
```
*Look at the `PPID` column. That is the Parent Process ID.*
*(If you don't know the zombie's PID, you can list all zombies and their parents using: `ps -A -ostat,pid,ppid,cmd | grep -e '^[Zz]'`)*
### Step 2: Notify the parent (The polite way)
Sometimes, the parent process just needs a reminder to clean up its dead children. You can send a `SIGCHLD` signal to the parent process. This tells the parent, "One of your children died, please collect its exit status."
```bash
kill -s SIGCHLD <PPID>
```
Check if the zombie is gone. If it is, you are done.
### Step 3: Kill the parent (The forceful way)
If the parent process is poorly written or completely frozen, it will ignore the `SIGCHLD` signal. In this case, your only option is to kill the parent process.
When a parent process dies, all of its children (including zombies) are adopted by `init` or `systemd` (PID 1), which automatically cleans up zombie processes.
**⚠️ WARNING:** Before you do this, check what the parent process is. If it's a critical service (like a database or a web server), killing it will take that service offline. **Never try to kill PID 1.**
If it is safe to kill the parent, try asking it to close gracefully first:
```bash
kill -15 <PPID>
```
If the parent doesn't respond, force kill the parent:
```bash
kill -9 <PPID>
```
Once the parent dies, the zombie process will immediately disappear from your process table.
### What if the Parent is PID 1?
If you look at the PPID in Step 1 and it is `1` (systemd or init), it means the system's main process has adopted it but is failing to reap it. This is incredibly rare and usually indicates a bug in the kernel or a process stuck in un-interruptible hardware sleep (often caused by a failing hard drive or bad network mount). In this scenario, the only way to clear the zombie is to **reboot the server.**

End of response · 45 lines · 2,514 characters · sha256 82220d6bf8e0a6f2f036e116c1f8fcaf335fb4e2069faa5ea8d8982d56753a02