$linuxjunkies
>

signal

also: POSIX signal, IPC signal

A signal is a software interrupt that delivers a notification to a process, allowing the operating system or other processes to communicate asynchronously with that process. Signals can trigger predefined actions like termination, suspension, or custom handling.

Signals are a fundamental inter-process communication mechanism in Linux. When a signal is sent to a process, the kernel interrupts its normal execution flow and delivers a message identified by a number (like SIGTERM or SIGKILL). Each signal has a default action—typically terminating the process—but processes can install custom signal handlers to respond differently.

Common signals include SIGTERM (15, request termination), SIGKILL (9, force termination), SIGSTOP (19, pause), SIGCONT (18, resume), and SIGINT (2, interrupt—sent by Ctrl+C). You can send signals using commands like kill -SIGTERM 1234 (where 1234 is a process ID) or programmatically via the kill() system call.

For example, running kill -9 12345 sends SIGKILL to process 12345, forcing immediate termination. By contrast, kill -15 12345 sends SIGTERM, giving the process a chance to clean up before exiting. Processes can ignore most signals, but SIGKILL and SIGSTOP cannot be caught or ignored.

Related terms