signal

A short notification the kernel delivers to a process, such as please stop or stop now.

In more detail

Signals have names and numbers: SIGTERM (15) asks a process to exit, SIGKILL (9) forces it, SIGINT (2) is sent by Ctrl+C and SIGHUP (1) reports a closed terminal or asks for a reload. A process can handle or ignore most signals, but not SIGKILL. A process ended by a signal reports exit code 128 plus the signal number.

Examples

Platforms stop a process by sending it a signal; registering a handler for SIGTERM is the whole difference between a graceful stop and a kill.
Go: signal.Notify(stop, syscall.SIGTERM)

Related terms

Taught in

References

Certification courses