GPT on Question 13, Oct 3
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 only as an entry in the process table until its parent reads its exit status.
1. Confirm it is a zombie
ps -o pid,ppid,state,cmd -p <PID>
A state of Z means zombie.
2. Find and notify its parent
Note the PPID, then ask the parent to reap exited children:
kill -SIGCHLD <PPID>
Whether this works depends on the parent program’s signal handling.
3. Restart or terminate the parent
If the zombie remains, restart the parent service:
sudo systemctl restart <service>
As a last resort, terminate the parent:
kill -TERM <PPID> # If it still does not exit: sudo kill -KILL <PPID>
This can disrupt the service and its other child processes. Once the parent exits, the zombie is normally adopted and reaped by PID 1 (systemd/init).
To list zombies and their parents:
ps -eo pid,ppid,state,cmd | awk '$3 == "Z"'
If the process state is D, not Z, it is blocked in uninterruptible kernel I/O and is a different problem; signals usually take effect only after the I/O returns.
Exact recordShowHideThe model id, the run, the verbatim text with line numbers and its full sha256
- Scored
- answered
- Received
- 2026-10-03 09:04:37 UTC
- Run
- 20261003T090008Z-b2d35e
- Served by
- OpenAI · HTTP 200 · finish stop
- Size
- 1,165 characters · 393 tokens out incl. hidden reasoning · 5.5 s
End of response · 45 lines · 1,165 characters · sha256 8f83b06b366e31ed79c1f49fb92eda0d86b13d76e85677f9bcf60cf6b9dd84f9