A list of Linux signals

Every signal has a name starting with SIG and is defined as a positive unique integer number. In a shell prompt, the kill -l command will display all signals with signal number and corresponding signal name. Signal numbers are defined in the /usr/include/bits/signum.h file, and the source file is /usr/src/linux/kernel/signal.c.

A process will receive a signal when it is running in user mode. If the receiving process is running in kernel mode, the execution of the signal will start only after the process returns to user mode.

The following is a list of signals used in Linux.

Signals in Linux
Signal Number Signal Name Signal Effect
1 SIGHUP Hang up—indicates that the terminal a process is using has closed. Daemons that don’t run in a terminal often respond to this signal by rereading configuration files or restarting their logging tools.
2 SIGINT Interrupt—end program operation. The kernel sends this signal when you press Ctrl+C.
3 SIGQUIT Quit—terminate and leave a core file for debugging purposes. Normally initiated by a user action.
6 SIGABRT Abort—terminate and leave a core file for debugging purposes. Normally initiated by a debugging process or self-detected error.
9 SIGKILL Kill—end program operation ungracefully; the program may not save open files, etc.
10 SIGUSR1 User signal 1—Effect varies from one program to another.
12 SIGUSR2 User signal 2—Effect varies from one program to another.
15 SIGTERM Terminate—end program operation gracefully (closing open files, etc.).
18 SIGCONT Continue—resume processing; undo the effect of a SIGSTOP signal.
19 SIGSTOP Stop—suspend program operation, similar (but not identical) to the effect of pressing Ctrl+Z.

Note: Processes can ignore, block, or catch all signals except SIGSTOP and SIGKILL. If a process catches a signal, it means that it includes code that will take appropriate action when the signal is received. If the signal is not caught by the process, the kernel will take default action for the signal.

There are a couple more signals but the above mentioned are the most important.

0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Related posts: