GPT on Question 13, Sep 25
How do I kill a zombie process in Linux that won't respond to SIGTERM?A zombie process cannot be killed—it is already dead. 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,stat,cmd -p <PID>
A zombie has Z in the STAT column.
- 2.Ask the parent to reap its children:
kill -SIGCHLD <PPID>
This only works if the parent handles SIGCHLD correctly.
- 3.If it remains, restart or terminate the parent process:
kill -TERM <PPID> # Last resort: kill -KILL <PPID>
When the parent exits, the zombie is adopted by PID 1 (or a subreaper), which should reap it. Be cautious: killing the parent may disrupt a service or other child processes; prefer restarting it through its service manager, for example:
sudo systemctl restart <service>
If the parent is your current shell, this may reap it:
wait <PID>
kill -9 <zombie-PID> has no effect. Zombies consume only a process-table entry, not CPU or normal process memory. If many accumulate, fix the parent application so it calls wait()/waitpid().
If STAT is D rather than Z, it is not a zombie—it is stuck in uninterruptible I/O and usually cannot be killed until the kernel operation returns.
Exact recordShowHideThe model id, the run, the verbatim text with line numbers and its full sha256
- Scored
- answered
- Received
- 2026-09-25 09:05:17 UTC
- Run
- 20260925T090007Z-f08d1f
- Served by
- OpenAI · HTTP 200 · finish stop
- Size
- 1,262 characters · 518 tokens out incl. hidden reasoning · 7.3 s
End of response · 41 lines · 1,262 characters · sha256 d7ff97d292b503f9b1ddcbed8b9f155aaeeadc915823a096bf4ad88c93bbe366