GPT on Question 13, Sep 28
How do I kill a zombie process in Linux that won't respond to SIGTERM?You can’t kill a zombie process with SIGTERM or even SIGKILL. A zombie has already exited; it remains only because its parent has not collected its exit status.
- 1.Confirm it is a zombie and find its parent:
```bash
ps -o pid,ppid,state,cmd -p <PID>
```
StateZmeans zombie.
- 2.Ask the parent to reap exited children:
```bash
kill -SIGCHLD <PPID>
```
This only helps if the parent handlesSIGCHLDcorrectly.
- 3.If it remains, restart or terminate the parent process, after considering service impact:
```bash
kill -TERM <PPID>
```
If necessary:
```bash
kill -KILL <PPID>
```
The zombie will be adopted and reaped by PID 1 or a subreaper.
For a managed service, prefer restarting it:
sudo systemctl restart <service>
A single zombie uses no CPU and very little memory, so it is generally harmless. Many accumulating zombies indicate a bug in the parent application, which should be fixed to call wait()/waitpid().
If the process state is D rather than Z, it is in uninterruptible sleep—usually waiting on I/O—and that is a different issue; signals may not take effect 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-28 09:04:49 UTC
- Run
- 20260928T090007Z-07d4be
- Served by
- OpenAI · HTTP 200 · finish stop
- Size
- 1,190 characters · 368 tokens out incl. hidden reasoning · 5.6 s
You can’t kill a **zombie process** with `SIGTERM` or even `SIGKILL`. A zombie has already exited; it remains only because its parent has not collected its exit status.
1. Confirm it is a zombie and find its parent:
```bash
ps -o pid,ppid,state,cmd -p <PID>
```
State `Z` means zombie.
2. Ask the parent to reap exited children:
```bash
kill -SIGCHLD <PPID>
```
This only helps if the parent handles `SIGCHLD` correctly.
3. If it remains, restart or terminate the parent process, after considering service impact:
```bash
kill -TERM <PPID>
```
If necessary:
```bash
kill -KILL <PPID>
```
The zombie will be adopted and reaped by PID 1 or a subreaper.
For a managed service, prefer restarting it:
```bash
sudo systemctl restart <service>
```
A single zombie uses no CPU and very little memory, so it is generally harmless. Many accumulating zombies indicate a bug in the parent application, which should be fixed to call `wait()`/`waitpid()`.
If the process state is `D` rather than `Z`, it is in uninterruptible sleep—usually waiting on I/O—and that is a different issue; signals may not take effect until the kernel operation returns.
End of response · 33 lines · 1,190 characters · sha256 55a757f919d6640e3c9017252f7b6823ed9f6be196eb7fe9c694064a00ea603a