GPT on Question 13, Sep 19
How do I kill a zombie process in Linux that won't respond to SIGTERM?You can’t kill a zombie process with SIGTERM or even SIGKILL. A zombie has already exited; only its process-table entry remains 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.Find and signal its parent:
PPID=$(ps -o ppid= -p <PID> | tr -d ' ') kill -SIGCHLD "$PPID"
This may prompt a correctly written parent to reap exited children.
- 3.If it remains, restart or terminate the parent process:
kill -TERM "$PPID" # As a last resort: kill -KILL "$PPID"
When the parent exits, the zombie is adopted by PID 1 (or another subreaper), which should reap it. Be careful: killing the parent may disrupt a service; prefer restarting it through its service manager:
sudo systemctl restart <service>
If the process state is D rather than Z, it is not a zombie—it is stuck in uninterruptible kernel sleep, typically waiting on I/O, and signals will not take effect until that wait returns.
Exact recordShowHideThe model id, the run, the verbatim text with line numbers and its full sha256
- Scored
- answered
- Received
- 2026-09-19 09:04:59 UTC
- Run
- 20260919T090005Z-86161c
- Served by
- OpenAI · HTTP 200 · finish stop
- Size
- 1,038 characters · 356 tokens out incl. hidden reasoning · 5.5 s
End of response · 32 lines · 1,038 characters · sha256 23b85dca4ba748209555991d3438f28590cbbbe09f1e73066f6b60a4327f8c67