GPT on Question 13, Oct 2
How do I kill a zombie process in Linux that won't respond to SIGTERM?A zombie process cannot be killed—not 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 state of Z or <defunct> means zombie.
2. Find and notify its parent
PPID=$(ps -o ppid= -p <PID> | tr -d ' ') ps -fp "$PPID" sudo kill -SIGCHLD "$PPID"
SIGCHLD may prompt a correctly written parent to reap the child.
3. Restart or terminate the parent
If the parent is a service, restart it safely:
sudo systemctl restart <service>
As a last resort, terminate the parent:
sudo kill -TERM "$PPID" # If it still does not exit: sudo kill -KILL "$PPID"
After the parent exits, the zombie is adopted and normally reaped by PID 1 or a subreaper. Be cautious: killing the parent may disrupt a service or other child processes.
If the process state is D rather than Z, it is not a zombie; it is stuck in uninterruptible I/O and usually requires resolving the underlying disk/network/filesystem issue, or sometimes rebooting.
Exact recordShowHideThe model id, the run, the verbatim text with line numbers and its full sha256
- Scored
- answered
- Received
- 2026-10-02 09:05:13 UTC
- Run
- 20261002T090008Z-e178a0
- Served by
- OpenAI · HTTP 200 · finish stop
- Size
- 1,140 characters · 377 tokens out incl. hidden reasoning · 6.2 s
End of response · 39 lines · 1,140 characters · sha256 2942f77ad2eb6e9865846291c7fe968b535f121fb5700e89ce7627335ba1d515