SIGTERM Signal Explained (Signal 15)
What the Linux SIGTERM signal does and when it's used.
Published October 23, 2026
SIGTERM (signal 15) politely asks a process to terminate. Unlike SIGKILL it can be caught, so programs can finish work, close files and exit cleanly.
What it does
Default action: Terminate. It can be caught with a signal handler.
Typically sent by: kill PID (the default), systemd stop, docker stop (then SIGKILL after a timeout). List all signals with kill -l.
Signal number and delivery
kill -l | grep SIGTERM
15) SIGTERM
kill -15 1234 # or kill -TERM 1234
(signal delivered to process 1234)
Practical examples
Send it from the shell
kill -15 <PID>
kill -SIGTERM <PID>
pkill -15 nginxHandle it in a script
trap 'echo got SIGTERM; cleanup; exit' SIGTERM
while true; do sleep 1; doneHandle it in code
import signal, sys
def handler(sig, frame):
print('received', sig)
sys.exit(0)
signal.signal(signal.SIGTERM, handler)Common mistakes
- Using kill -9 before trying SIGTERM.
- Forgetting to find the right PID (ps aux | grep, pgrep).
- Not handling signals in long-running services.
Key takeaways
- SIGTERM is signal 15.
- Default: Terminate.
- Use kill -l to list all signals.
FAQ
Why does docker stop wait 10 seconds?
It sends SIGTERM, waits, then SIGKILL if the process has not exited.
How do I list all signals?
Run kill -l.