GPT on Question 13, Sep 29
How do I kill a zombie process in Linux that won't respond to SIGTERM?A zombie process cannot be killed—even with SIGKILL—because it has already exited. It remains in the process table only because its parent has not collected its exit status.
1. Confirm it is a zombie
ps -o pid,ppid,state,cmd -p <PID>
A zombie has state Z or shows <defunct>.
2. Identify the parent
ps -o ppid= -p <PID>
Then inspect it:
ps -fp <PPID>
3. Ask the parent to reap its children
kill -SIGCHLD <PPID>
This works only if the parent handles SIGCHLD correctly.
4. Restart or terminate the parent
If safe, restart the parent service:
sudo systemctl restart <service>
Otherwise, terminate the parent:
kill -TERM <PPID>
As a last resort:
kill -KILL <PPID>
When the parent exits, the zombie is normally adopted and reaped by PID 1 (or a subreaper). Killing the parent may disrupt other processes, so check what it owns first.
If zombies persist under a service or inside a container, the parent/PID 1 process likely has a bug and is not calling wait(); fix or restart that process. If the process state is D rather than Z, it is not a zombie—it is stuck in uninterruptible I/O and requires resolving the underlying I/O/kernel issue.
Exact recordShowHideThe model id, the run, the verbatim text with line numbers and its full sha256
- Scored
- answered
- Received
- 2026-09-29 09:04:53 UTC
- Run
- 20260929T090007Z-334891
- Served by
- OpenAI · HTTP 200 · finish stop
- Size
- 1,267 characters · 417 tokens out incl. hidden reasoning · 6.2 s
End of response · 53 lines · 1,267 characters · sha256 e23f745dc1561ddd691927ae5806fb4a9b4c8596f667599e3678b49768ddec81