GPT on Question 13, Sep 23
How do I kill a zombie process in Linux that won't respond to SIGTERM?You can’t kill a zombie process—even with SIGKILL. A zombie has already exited; it remains only 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 its parent:
ps -p <PID> -o ppid=
- 3.Ask the parent to reap exited children:
kill -SIGCHLD <PPID>
- 4.If that does not work, restart or terminate the parent process, preferably gracefully:
kill -TERM <PPID>
As a last resort:
kill -KILL <PPID>
When the parent exits, the zombie is adopted and normally reaped by PID 1 (systemd/init). Be cautious: killing the parent may disrupt a service or create additional orphaned processes; restarting the relevant service is often safer:
sudo systemctl restart <service>
If the process state 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 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-23 09:05:50 UTC
- Run
- 20260923T090022Z-9b7b3a
- Served by
- OpenAI · HTTP 200 · finish stop
- Size
- 1,027 characters · 346 tokens out incl. hidden reasoning · 7.5 s
You can’t kill a zombie process—even with `SIGKILL`. A zombie has already exited; it remains only because its parent has not collected its exit status.
1. Confirm it is a zombie (`STAT` contains `Z`):
```bash
ps -o pid,ppid,stat,cmd -p <PID>
```
2. Find its parent:
```bash
ps -p <PID> -o ppid=
```
3. Ask the parent to reap exited children:
```bash
kill -SIGCHLD <PPID>
```
4. If that does not work, restart or terminate the parent process, preferably gracefully:
```bash
kill -TERM <PPID>
```
As a last resort:
```bash
kill -KILL <PPID>
```
When the parent exits, the zombie is adopted and normally reaped by PID 1 (`systemd`/`init`). Be cautious: killing the parent may disrupt a service or create additional orphaned processes; restarting the relevant service is often safer:
```bash
sudo systemctl restart <service>
```
If the process state 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 or the system is rebooted.
End of response · 39 lines · 1,027 characters · sha256 0468cf57b1d7fda351288fd114448ae446e1e1a0f4e9e78afe5c6d96e185a842