SIGUSR1 and SIGUSR2

From Wikipedia, the free encyclopedia

SIGUSR1 and SIGUSR2
Description: User-defined signals
Default action: Abnormal termination of the process
SA_SIGINFO macros
None

On POSIX-compliant platforms, SIGUSR1 and SIGUSR2 are signals sent to computer programs to indicate user-defined conditions. The symbolic constants for them are defined in the header file signal.h. Symbolic signal names are used because signal numbers can vary across platforms.

[edit] Etymology

SIG is a common prefix for signal names. USR is an abbreviation for user-defined.

[edit] Usage

Along with the realtime signals SIGRTMIN through SIGRTMAX, the semantics of SIGUSR1 and SIGUSR2 are not specified by POSIX. Use varies widely from one application to another.

Many applications use USR1 to synchronize internal data between threads and processes, for example by the LinuxThreads threading library under Linux 2.0. Other applications, such as dd, will print status when given this signal. USR1 is also often used to tell an application to reload config files; for example, sending the Apache HTTP Server a USR1, will ask the server send to stop allowing new connections, wait for the current ones to die, reread the config files, and restart the server, allowing for relatively smooth in-production changes.

[edit] See also

POSIX Signals
SIGABRT | SIGALRM | SIGFPE | SIGHUP | SIGILL | SIGINT | SIGKILL | SIGPIPE | SIGQUIT | SIGSEGV | SIGTERM | SIGUSR1 | SIGUSR2 | SIGCHLD | SIGCONT | SIGSTOP | SIGTSTP | SIGTTIN | SIGTTOU | SIGBUS | SIGPOLL | SIGPROF | SIGSYS | SIGTRAP | SIGURG | SIGVTALRM | SIGXCPU | SIGXFSZ | Realtime Signals are user definable—SIGRTMIN+n through SIGRTMAX.
Common non-POSIX signals and synonyms
SIGIOT | SIGEMT | SIGSTKFLT | SIGIO | SIGCLD | SIGINFO | SIGPWR (SIGINFO) | SIGLOST | SIGWINCH | SIGUNUSED
In other languages