GPT on Question 13, Oct 1
How do I kill a zombie process in Linux that won't respond to SIGTERM?You can’t kill a zombie process—not even with SIGKILL. A zombie has already exited; it remains only because its parent has not collected its exit status.
- 1.Confirm it is a zombie (
STATcontainsZ):
ps -o pid,ppid,stat,cmd -p <PID>
- 2.Identify the parent:
ps -p <PPID> -o pid,stat,cmd
- 3.Ask the parent to reap exited children:
sudo kill -SIGCHLD <PPID>
- 4.If the parent is faulty, restart or terminate it carefully:
sudo kill -TERM <PPID> # Last resort: sudo kill -KILL <PPID>
When the parent exits, the zombie is adopted and normally reaped by PID 1. In containers, ensure PID 1 is a proper init/reaper, such as tini or dumb-init.
If the process state is D rather than Z, it is not a zombie—it is stuck in uninterruptible I/O, and signals generally take effect only after the kernel operation returns.
Exact recordShowHideThe model id, the run, the verbatim text with line numbers and its full sha256
- Scored
- answered
- Received
- 2026-10-01 09:04:46 UTC
- Run
- 20261001T090007Z-857bc9
- Served by
- OpenAI · HTTP 200 · finish stop
- Size
- 875 characters · 328 tokens out incl. hidden reasoning · 5.8 s
You can’t kill a zombie process—not even with `SIGKILL`. A zombie has already exited; it remains only because its parent has not collected its exit status.
1. Confirm it is a zombie (`STAT` contains `Z`):
```bash
ps -o pid,ppid,stat,cmd -p <PID>
```
2. Identify the parent:
```bash
ps -p <PPID> -o pid,stat,cmd
```
3. Ask the parent to reap exited children:
```bash
sudo kill -SIGCHLD <PPID>
```
4. If the parent is faulty, restart or terminate it carefully:
```bash
sudo kill -TERM <PPID>
# Last resort:
sudo kill -KILL <PPID>
```
When the parent exits, the zombie is adopted and normally reaped by PID 1. In containers, ensure PID 1 is a proper init/reaper, such as `tini` or `dumb-init`.
If the process state is `D` rather than `Z`, it is not a zombie—it is stuck in uninterruptible I/O, and signals generally take effect only after the kernel operation returns.
End of response · 31 lines · 875 characters · sha256 57608639a86c187720387f9f11572fedd3c98eee9848bd9fa942d2172c48026b