← Back to all fixes

kill command does not stop the process

The Issue

`kill <pid>` runs without error but the process is still listed in `ps aux`.

Root Cause

`kill` without flags sends SIGTERM which the process can ignore or handle. A zombie process cannot be killed — it is already dead, waiting for its parent to call wait(). A process in uninterruptible sleep (D state) cannot be killed until the I/O completes.

How to Fix
  1. Use SIGKILL: `kill -9 <pid>` — cannot be caught or ignored by the process
  2. Check process state first: `ps aux | grep <name>` — look at the STAT column
  3. If state is Z (zombie): kill the parent process instead
  4. If state is D (disk wait): wait for I/O to complete or check for hung NFS/disk
  5. Find PID by name: `pgrep -l nginx` or `pidof nginx`