Definition
A signal is a small numeric notification the kernel delivers asynchronously to a running process. Each signal carries a meaning by convention — SIGINT means interrupt, SIGTERM means polite termination, SIGKILL means immediate forced termination, SIGSEGV means segmentation fault, SIGHUP means the controlling terminal hung up — and each has a default action the process takes if it has not installed a handler.
Signals are the operating system's lightweight inter-process communication primitive. They carry no payload beyond the signal number itself; they exist to nudge a process to do something, not to transmit data. Anything more elaborate — request, reply, byte stream — uses pipes, sockets, or shared memory instead.
Why it matters
How it works
When something happens that warrants interrupting a process, the kernel sets a bit in that process's pending-signal mask. At the next scheduling opportunity, the kernel checks the mask, picks a pending signal, and either runs the process's installed handler or applies the default action. Defaults vary by signal: terminate with a core dump for SIGSEGV, terminate without a dump for SIGINT, stop for SIGSTOP, ignore for SIGCHLD on some systems. A process can change the action for most signals using the sigaction system call or, in shells, the trap builtin.
Signals are sent in several ways. The kill command sends a chosen signal to a chosen process id. The terminal driver sends SIGINT when Ctrl-C is pressed and SIGTSTP when Ctrl-Z is pressed. The kernel sends SIGSEGV when a process touches an invalid memory address, SIGPIPE when it writes to a pipe with no reader, and SIGCHLD when one of its children exits. Service managers like systemd send SIGTERM during a graceful shutdown and escalate to SIGKILL if the process does not exit within a timeout. The small alphabet of signal numbers — typically 31 in the classic set — is what makes the entire scheme so portable: every Unix kernel speaks the same simple language to every process it runs.