Linux Signals List

By:    Updated: February 27,2017

Signals are software interrupts. Most nontrivial application programs need to deal with signals. Signals provide a way of handling asynchronous events—for example, a user at a terminal typing the interrupt key to stop a program or the next program in a pipeline terminating prematurely.

# uname -a

The linux kernel version is 4.9.7 on my CentOS 7 system. First, every signal has a name. These names all begin with the three characters SIG.

kill -l
 1) SIGHUP       2) SIGINT       3) SIGQUIT      4) SIGILL       5) SIGTRAP
 6) SIGABRT      7) SIGBUS       8) SIGFPE       9) SIGKILL     10) SIGUSR1
11) SIGSEGV     12) SIGUSR2     13) SIGPIPE     14) SIGALRM     15) SIGTERM
16) SIGSTKFLT   17) SIGCHLD     18) SIGCONT     19) SIGSTOP     20) SIGTSTP
21) SIGTTIN     22) SIGTTOU     23) SIGURG      24) SIGXCPU     25) SIGXFSZ
26) SIGVTALRM   27) SIGPROF     28) SIGWINCH    29) SIGIO       30) SIGPWR
31) SIGSYS      34) SIGRTMIN    35) SIGRTMIN+1  36) SIGRTMIN+2  37) SIGRTMIN+3
38) SIGRTMIN+4  39) SIGRTMIN+5  40) SIGRTMIN+6  41) SIGRTMIN+7  42) SIGRTMIN+8
43) SIGRTMIN+9  44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13
48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12
53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9  56) SIGRTMAX-8  57) SIGRTMAX-7
58) SIGRTMAX-6  59) SIGRTMAX-5  60) SIGRTMAX-4  61) SIGRTMAX-3  62) SIGRTMAX-2
63) SIGRTMAX-1  64) SIGRTMAX

Action

Action Description
Term Terminate the process
Core Terminate the process and dump core
Ign Ignore the signal (cause a process toterminate and produce a core dump file, a disk file (named core of the current working directory of the process. On Linux, the name is configured through /proc/sys/kernel/core_pattern) containing animage of the process's memory at the time of termination.)
Stop Stop the process
Cont Continue the process if it is currently stopped

Standard signals

Name Value Default Action Description
SIGHUP 1 Term Hangup detected on controlling terminalor death of controlling process.
SIGINT 2 Term Interrupt from keyboard (often DELETE or Control-C)
SIGQUIT 3 Term + Core Quit from keyboard (often Control-backslash)
SIGILL 4 Term + Core Illegal Instruction
SIGTRAP 5 Term + Core Trace/breakpoint trap
SIGABRT 6 Term + Core Abort signal from abort (calling the abort function)
SIGBUS 10,7,10 Term + Core Bus error (bad memory access)
SIGFPE 8 Term + Core Arithmetic exception (such as divide by 0, floating-point overflow, and so on)
SIGKILL 9 Term Kill signal (It provides the system administrator with a sure way to kill any process)
SIGUSR1 30,10,16 Term User-defined signal 1, for use in application programs
SIGSEGV 11 Term + Core Invalid memory reference (stands for "segmentation violation")
SIGUSR2 31,12,17 Term User-defined signal 2, for use in application programs
SIGPIPE 13 Term Broken pipe: write to pipe with noreaders (If we write to a pipeline but the reader has terminated, SIGPIPE is generated)
SIGALRM 14 Term Timer signal from alarm (calling the alarm function)
SIGTERM 15 Term Termination signal (Using SIGTERM gives programs a chance to terminate gracefully by cleaning up before exiting (in contrast to SIGKILL, which can't be caught or ignored))
SIGSTKFLT -,16,- Term Stack fault on coprocessor (unused)
SIGCHLD 20,17,18 Ign Child stopped or terminated (Whenever a process terminates or stops, the SIGCHLD signal is sent to the parent. By default, this signal is ignored, so the parent must catch this signal if it wants to be notified whenever a child's status changes. The normal action in the signal-catching function is to call one of the wait functions to fetch the child's process ID and termination status)
SIGCONT 19,18,25 Cont / Ign Continue if a process stopped
SIGSTOP 17,19,23 Stop Stop process
SIGTSTP 18,20,24 Stop Stop typed at terminal (often Control-Z)
SIGTTIN 21,21,26 Stop Terminal input for background process (generated when a process in a background process group tries to read from its controlling terminal)
SIGTTOU 22,22,27 Stop Terminal output for background process (generated when a process in a background process group tries to write to its controlling terminal)
SIGURG 16,23,21 Ign Urgent condition on socket (generated when out-of-band data is received on a network connection)
SIGXCPU 24,24,30

Term

/

(Term + Core)

CPU time limit exceeded (generated when a process exceeds its soft CPU time limit)
SIGXFSZ 25,25,31

Term

/

(Term + Core)

File size limit exceeded (generated when a process exceeds its soft file size limit)
SIGVTALRM 26,26,28 Term Virtual alarm clock (generated when a virtual interval timer set by the setitimer(2) function expires)
SIGPROF 27,27,29 Term Profiling timer expired (generated when a profiling interval timer set by the setitimer(2) function expires)
SIGWINCH 28,28,20 Ign Window resize signal (The kernel maintains the size of the window associated with each terminal and pseudo terminal. A process can get and set the window size with the ioctl function. If a process changes the window size from its previous value using the ioctl set-window-size command, the kernel generates the SIGWINCH signal for the foreground process group)
SIGIO 23,29,22 Term / Ign I/O now possible (Indicates an asynchronous I/O event)
SIGPWR 29,30,19 Term / Ign Power fail/restart (Its main use is on a system that has an
uninterruptible power supply (UPS))
SIGSYS 12,31,12 Term + Core Bad argument to routine (Invalid system call. This might happen if you build a program that uses a new system call and you then try to run the same binary on an older version of the operating system where the system call doesn't exist)

 

Note: The signals SIGKILL and SIGSTOP cannot be caught, blocked, orignored.

Real-time signals

Linux supports real-time signals as originally defined in the POSIX.1b real-time extensions (and now included in POSIX.1-2001).The range of supported real-time signals is defined by the macros SIGRTMIN and SIGRTMAX. The Linux kernel supports a range of 32 different real-time signals, numbered 33 to 64. Unlike standard signals, real-time signals have no predefined meanings: the entire set of real-time signals can be used for application-defined purposes. The default action for an unhandled real-time signal is to terminate the receiving process.

More in Development Center
New on Valinv
Sources
  • http://man7.org/linux/man-pages/man7/signal.7.html
Related Articles
Sponsored Links