MODELDRIFT.WATCH

Question 13 · Sep 11 · Day 2

Gemini on Question 13, Sep 11

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, not even with kill -9 (SIGKILL).

This is because a zombie process is already dead. It has finished executing, but it still has an entry in the process table because its parent process hasn't read its exit status yet.

Because the process is dead, it cannot receive or respond to any signals (like SIGTERM or SIGKILL). To get rid of a zombie, you have to deal with its parent process.

Here is the step-by-step guide to clearing a zombie process:

Step 1: Find the Parent Process ID (PPID)

You need to find the ID of the process that created the zombie. Run this command, replacing <zombie_pid> with the PID of your zombie:

ps -o pid,ppid,stat,comm -p <zombie_pid>

Look at the PPID column. This is the Parent Process ID.
(Note: If the state column (STAT) has a Z, it confirms it is a zombie).

Step 2: Nudge the Parent Process

Sometimes, the parent process is just hanging or busy. You can try sending a SIGCHLD signal to the parent. This tells the parent, "Hey, your child died, please acknowledge it."

kill -s SIGCHLD <PPID>

Check if the zombie is gone. If the parent is poorly programmed or frozen, this won't work, and you must move to Step 3.

Step 3: Kill the Parent Process

If the parent refuses to reap the zombie, you must kill the parent process.

Warning: Before doing this, check what the parent process is. If the parent is a crucial system service or an application you are actively using, killing it will stop that service!

To kill the parent, send it a SIGTERM (or SIGKILL if it's stubborn):

kill -15 <PPID>  # Try SIGTERM first
kill -9 <PPID>   # Use SIGKILL if it won't die

What happens after you kill the parent?

When the parent process dies, the zombie is "orphaned." Linux is designed so that all orphaned processes are immediately adopted by the init or systemd process (PID 1). PID 1 periodically cleans up (reaps) all adopted zombies automatically. The zombie will instantly vanish from your process table.

Last Resort: Reboot

If the parent process is PID 1 (which is incredibly rare for a zombie), or if you are dealing with an unkillable process in "D" state (uninterruptible sleep) rather than a "Z" state (Zombie), the only way to clear it is to reboot the system.

sha256 0c2244ee879b… · 18 tokens in · 1,718 out · 16.1 s · via Google · stopped on its own

Sep 11, 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-11 09:00:01 UTC (matches the pin)
Date
2026-09-11 · run 20260911T090002Z-da0dd3 · scorer v1
Scored
answered
sha256
0c2244ee879b3f964bca751dc2e73fb109ba511794cf8661455f297e2493a6a4
Permalink
https://modeldrift.watch/r/2026-09-11/R1/google/gemini-3.1-pro-preview/
Scored
answered
Received
2026-09-11 09:06:30 UTC
Run
20260911T090002Z-da0dd3
Served by
Google · HTTP 200 · finish stop
Size
2,372 characters · 1,718 tokens out incl. hidden reasoning · 16.1 s
The short answer is: **You cannot kill a zombie process directly, not even with `kill -9` (SIGKILL).**
This is because a zombie process is **already dead**. It has finished executing, but it still has an entry in the process table because its parent process hasn't read its exit status yet.
Because the process is dead, it cannot receive or respond to any signals (like `SIGTERM` or `SIGKILL`). To get rid of a zombie, you have to **deal with its parent process.**
Here is the step-by-step guide to clearing a zombie process:
### Step 1: Find the Parent Process ID (PPID)
You need to find the ID of the process that created the zombie. Run this command, replacing `<zombie_pid>` with the PID of your zombie:
```bash
ps -o pid,ppid,stat,comm -p <zombie_pid>
```
Look at the **PPID** column. This is the Parent Process ID.
*(Note: If the state column (`STAT`) has a `Z`, it confirms it is a zombie).*
### Step 2: Nudge the Parent Process
Sometimes, the parent process is just hanging or busy. You can try sending a `SIGCHLD` signal to the parent. This tells the parent, "Hey, your child died, please acknowledge it."
```bash
kill -s SIGCHLD <PPID>
```
Check if the zombie is gone. If the parent is poorly programmed or frozen, this won't work, and you must move to Step 3.
### Step 3: Kill the Parent Process
If the parent refuses to reap the zombie, you must kill the parent process.
**Warning:** *Before doing this, check what the parent process is. If the parent is a crucial system service or an application you are actively using, killing it will stop that service!*
To kill the parent, send it a `SIGTERM` (or `SIGKILL` if it's stubborn):
```bash
kill -15 <PPID> # Try SIGTERM first
kill -9 <PPID> # Use SIGKILL if it won't die
```
### What happens after you kill the parent?
When the parent process dies, the zombie is "orphaned." Linux is designed so that all orphaned processes are immediately adopted by the `init` or `systemd` process (PID 1). PID 1 periodically cleans up (reaps) all adopted zombies automatically. The zombie will instantly vanish from your process table.
### Last Resort: Reboot
If the parent process is PID 1 (which is incredibly rare for a zombie), or if you are dealing with an unkillable process in "D" state (uninterruptible sleep) rather than a "Z" state (Zombie), the only way to clear it is to **reboot the system**.

End of response · 42 lines · 2,372 characters · sha256 0c2244ee879b3f964bca751dc2e73fb109ba511794cf8661455f297e2493a6a4