GPT on Question 13, Sep 13
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 and find its parent PID:
ps -o pid,ppid,stat,cmd -p <zombie_pid>
STAT containing Z indicates a zombie.
- 2.Ask the parent to reap exited children:
kill -SIGCHLD <parent_pid>
- 3.If that fails, restart or terminate the parent process, if safe:
kill -TERM <parent_pid> # Last resort: kill -KILL <parent_pid>
After the parent exits, the zombie is normally adopted and reaped by PID 1 or a subreaper.
Be cautious: killing the parent may disrupt a service or other child processes. For managed services, prefer:
sudo systemctl restart <service>
If the process state is D rather than Z, it is not a zombie; it is stuck in uninterruptible kernel I/O and usually cannot be killed until the I/O completes or the system is rebooted.
Exact recordShowHideThe model id, the run, the verbatim text with line numbers and its full sha256
- Scored
- answered
- Received
- 2026-09-13 09:04:52 UTC
- Run
- 20260913T090021Z-a7390a
- Served by
- OpenAI · HTTP 200 · finish stop
- Size
- 989 characters · 324 tokens out incl. hidden reasoning · 5.8 s
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 and find its parent PID:
```bash
ps -o pid,ppid,stat,cmd -p <zombie_pid>
```
`STAT` containing `Z` indicates a zombie.
2. Ask the parent to reap exited children:
```bash
kill -SIGCHLD <parent_pid>
```
3. If that fails, restart or terminate the parent process, if safe:
```bash
kill -TERM <parent_pid>
# Last resort:
kill -KILL <parent_pid>
```
After the parent exits, the zombie is normally adopted and reaped by PID 1 or a subreaper.
Be cautious: killing the parent may disrupt a service or other child processes. For managed services, prefer:
```bash
sudo systemctl restart <service>
```
If the process state is `D` rather than `Z`, it is not a zombie; it is stuck in uninterruptible kernel I/O and usually cannot be killed until the I/O completes or the system is rebooted.
End of response · 33 lines · 989 characters · sha256 0d35269d1775664482e843b67da6c3c452af7bc00395199aba29de1856a1fccf