Skip to content
The Signal Belfry

/static/campanario/en/sino/sigusr1/

Menu

SIG-023 · The user's

SIGUSR1

A bell with no factory ring: each program agrees on its own meaning.

POSIX set aside two signals for programs to use as they please, with no factory meaning. Each agrees on its own: dd answers with progress statistics, nginx reopens its log files.

The catch is in the default: with no handler installed, USR1 terminates the process. Ringing the bell at a program that wasn't expecting it isn't a conversation — it's an accident. Check the target's manual first.

$ dd if=/dev/urandom of=lixo.bin bs=1M count=4096 &
$ kill -USR1 $(pidof -s dd)
1379+0 records in
1379+0 records out
1446051840 bytes (1.4 GB) copied, 9 s, 160 MB/s
dd reports where it stands — because it agreed to that ring.