GPT on Question 13, Sep 20
How do I kill a zombie process in Linux that won't respond to SIGTERM?A true zombie process cannot be killed—it has already exited. It remains in the process table because its parent has not collected its exit status with wait().
- 1.Confirm it is a zombie and find its parent:
ps -o pid,ppid,state,cmd -p <PID>
A state of Z or <defunct> indicates a zombie.
- 2.Ask the parent to reap exited children:
kill -SIGCHLD <PPID>
- 3.If that does not work, restart or terminate the parent process:
kill -TERM <PPID> # Last resort: kill -KILL <PPID>
The zombie should then be adopted and reaped by PID 1 (or another subreaper). Be careful: killing the parent may disrupt a service, so use its service manager when possible:
sudo systemctl restart <service>
Sending SIGKILL to the zombie itself will have no effect:
kill -9 <zombie-PID> # ineffective
If zombies persist even after the parent exits, investigate PID 1/container-init behavior; restarting the container or, as a final resort, rebooting may be necessary.
Exact recordShowHideThe model id, the run, the verbatim text with line numbers and its full sha256
- Scored
- answered
- Received
- 2026-09-20 09:05:08 UTC
- Run
- 20260920T090019Z-bbedf3
- Served by
- OpenAI · HTTP 200 · finish stop
- Size
- 1,021 characters · 352 tokens out incl. hidden reasoning · 6.2 s
A true **zombie process cannot be killed**—it has already exited. It remains in the process table because its parent has not collected its exit status with `wait()`.
1. Confirm it is a zombie and find its parent:
```bash
ps -o pid,ppid,state,cmd -p <PID>
```
A state of `Z` or `<defunct>` indicates a zombie.
2. Ask the parent to reap exited children:
```bash
kill -SIGCHLD <PPID>
```
3. If that does not work, restart or terminate the parent process:
```bash
kill -TERM <PPID>
# Last resort:
kill -KILL <PPID>
```
The zombie should then be adopted and reaped by PID 1 (or another subreaper). Be careful: killing the parent may disrupt a service, so use its service manager when possible:
```bash
sudo systemctl restart <service>
```
Sending `SIGKILL` to the zombie itself will have no effect:
```bash
kill -9 <zombie-PID> # ineffective
```
If zombies persist even after the parent exits, investigate PID 1/container-init behavior; restarting the container or, as a final resort, rebooting may be necessary.
End of response · 37 lines · 1,021 characters · sha256 7cce8737db27878fc70467fc8dbbbb4f43bd4e7313324707a4489faf8a6c229f