Unit content
Unix signals
A Unix signal is an asynchronous notification delivered to a process to indicate that an event has occurred.
Signals are intentionally small: the signal number identifies the kind of event, but ordinary signals are not a general channel for transferring structured application data.
Common signals
SIGINT is commonly generated when a terminal user presses Ctrl+C. SIGTERM requests termination and can be handled by the process. SIGKILL forces termination and cannot be caught or ignored.
User-defined signals such as SIGUSR1 and SIGUSR2 can carry application-specific meanings.
Dispositions and handlers
Each signal has a default disposition such as terminating, stopping, continuing or being ignored. A process can install a handler or change the disposition of many signals.
Delivery is asynchronous
A signal can arrive between ordinary program operations. Code cannot assume it will be delivered only at a convenient point in the main control flow.
Signals work well for notifications such as “interrupt”, “terminate”, “reload” or “child changed state”. Larger data should normally travel through another IPC mechanism.