In Linux, signals are a form of inter-process communication (IPC) used to notify a process of an event that has occurred. They are a limited form of communication because they carry only a small amount of information: the signal number.
Think of signals as software interrupts. When a particular event occurs (like a user pressing Ctrl+C, a child process exiting, or a timer expiring), the operating system sends a signal to the affected process(es). The process can then be configured to react to this signal in a predefined way, such as terminating, ignoring the signal, or executing a specific signal handler function
Signal Name | Number (Default Action) | Description |
---|---|---|
SIGHUP | 1 (Terminate) | Hangup detected on controlling terminal or process death. |
SIGINT | 2 (Terminate) | Interrupt from keyboard (Ctrl+C). |
SIGQUIT | 3 (Core Dump) | Quit from keyboard (Ctrl+). |
SIGILL | 4 (Core Dump) | Illegal Instruction. |
SIGABRT | 6 (Core Dump) | Abort signal from abort() function. |
SIGFPE | 8 (Core Dump) | Floating-point exception. |
SIGKILL | 9 (Terminate) | Kill signal (cannot be caught or ignored). |
SIGSEGV | 11 (Core Dump) | Invalid memory reference (segmentation fault). |
SIGPIPE | 13 (Terminate) | Write to a pipe with no reader. |
SIGALRM | 14 (Terminate) | Timer signal from alarm() or setitimer() . |
SIGTERM | 15 (Terminate) | Termination signal (graceful termination request). |
SIGCHLD | 17 (Ignore) | Child process stopped or terminated. |
SIGCONT | 18 (Continue) | Continue process if stopped. |
SIGSTOP | 19 (Stop) | Stop process (cannot be caught or ignored). |
SIGTSTP | 20 (Stop) | Stop signal from keyboard (Ctrl+Z). |
SIGTTIN | 21 (Stop) | Background process trying to read from controlling terminal. |
SIGTTOU | 22 (Stop) | Background process trying to write to controlling terminal. |
SIGUSR1 | 30/10/16 (Terminate) | User-defined signal 1. |
SIGUSR2 | 31/12/17 (Terminate) | User-defined signal 2. |