SIGUSR2 Signal Explained (Signal 12)

What the Linux SIGUSR2 signal does and when it's used.

Published October 24, 2026

SIGUSR2 (signal 12) is a second user-defined signal. Like SIGUSR1 its meaning is chosen by each program, for example zero-downtime binary upgrades.

What it does

Default action: Terminate (unless handled). It can be caught with a signal handler.

Typically sent by: kill -USR2 PID. List all signals with kill -l.

Signal number and delivery

kill -l | grep SIGUSR2
12) SIGUSR2
kill -12 1234 # or kill -USR2 1234
(signal delivered to process 1234)

Practical examples

Send it from the shell

kill -12 <PID>
kill -SIGUSR2 <PID>
pkill -12 nginx

Handle it in a script

trap 'echo got SIGUSR2; cleanup; exit' SIGUSR2
while true; do sleep 1; done

Handle it in code

import signal, sys
def handler(sig, frame):
    print('received', sig)
    sys.exit(0)
signal.signal(signal.SIGUSR2, 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

  • SIGUSR2 is signal 12.
  • Default: Terminate (unless handled).
  • Use kill -l to list all signals.

FAQ

Where is it used?

Nginx and Unicorn use it to upgrade the binary without downtime.

How do I list all signals?

Run kill -l.

More Linux articles