GPT on Question 13, Sep 18
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—because it has already exited. It remains in the process table only because its parent hasn’t collected its exit status.
- 1.Confirm it is a zombie and find its parent:
```bash
ps -o pid,ppid,state,cmd -p <zombie_pid>
```
StateZindicates a zombie.
- 2.Ask the parent to process child exits:
```bash
kill -SIGCHLD <parent_pid>
```
- 3.If that doesn’t work, restart the parent process or service:
```bash
systemctl restart <service>
```
- 4.As a last resort, terminate the parent—after checking what it is:
```bash
ps -fp <parent_pid>
kill -TERM <parent_pid>
# If necessary:
kill -KILL <parent_pid>
```
The zombie should then be adopted and reaped by PID 1/systemd. Killing the parent may disrupt its service or other child processes, so use caution.
If zombies recur, the parent program has a bug: it needs to call wait()/waitpid() for exited children. Zombies consume a PID-table entry but no CPU and essentially no regular memory.
Exact recordShowHideThe model id, the run, the verbatim text with line numbers and its full sha256
- Scored
- answered
- Received
- 2026-09-18 09:05:43 UTC
- Run
- 20260918T090022Z-92b6f7
- Served by
- OpenAI · HTTP 200 · finish stop
- Size
- 1,043 characters · 371 tokens out incl. hidden reasoning · 9.6 s
You can’t kill a zombie process—even with `SIGKILL`—because it has already exited. It remains in the process table only because its parent hasn’t collected its exit status.
1. Confirm it is a zombie and find its parent:
```bash
ps -o pid,ppid,state,cmd -p <zombie_pid>
```
State `Z` indicates a zombie.
2. Ask the parent to process child exits:
```bash
kill -SIGCHLD <parent_pid>
```
3. If that doesn’t work, restart the parent process or service:
```bash
systemctl restart <service>
```
4. As a last resort, terminate the parent—after checking what it is:
```bash
ps -fp <parent_pid>
kill -TERM <parent_pid>
# If necessary:
kill -KILL <parent_pid>
```
The zombie should then be adopted and reaped by PID 1/systemd. Killing the parent may disrupt its service or other child processes, so use caution.
If zombies recur, the parent program has a bug: it needs to call `wait()`/`waitpid()` for exited children. Zombies consume a PID-table entry but no CPU and essentially no regular memory.
End of response · 28 lines · 1,043 characters · sha256 ad034aad2b15303b7016f14142256b2aedb9466fab6d0fe59e444860f339b113