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
- SIGTERM — The signal that politely asks a process to finish its work and exit.
- SIGKILL — The signal that ends a process immediately; it cannot be caught or ignored.
- SIGINT — The interrupt signal, sent to the foreground program when you press Control C, asking it to stop.
- SIGHUP — The hangup signal, sent to programs when the terminal they were started from closes.
- trap builtin — The builtin that runs a command or function when the shell receives a signal or exits, used for cleanup.
- kill — The command that sends a signal to a process or job, SIGTERM by default, despite its name.
- graceful shutdown — Stopping a service in an orderly way: finish current work, close connections, then exit.
- init process — The first process started on a system or in a container, with process ID 1 and special duties.
- process group — A set of related processes, such as all the commands in one pipeline, that the shell and kernel can signal together.
Taught in
- trap, Cleanup And Temporary Files — Bash Scripting & Command Line Automation
- Processes, Jobs And Signals — Bash Scripting & Command Line Automation
- Container Images The Exam Way — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Disposability, Dev Prod Parity And Logs — DevOps & Site Reliability Engineering
- Run, Stop, Restart And Remove A Container — Docker Architecture & Production Containers
- Commands, Logs, Exec And Exit Codes — Docker Architecture & Production Containers
- ARG, ENV, LABEL, EXPOSE And VOLUME — Docker Architecture & Production Containers
- CMD, ENTRYPOINT, USER And Process Signals — Docker Architecture & Production Containers
- Health Checks, Dependencies And Reliable Startup — Docker Architecture & Production Containers
- Integration Tests, Test Data And Compose Cleanup — Docker Architecture & Production Containers
- Diagnose Crashes, Resource Limits And Unhealthy Containers — Docker Architecture & Production Containers
- Harden And Deliver The Complete Service Stack — Docker Architecture & Production Containers
- From Local Containers To Kubernetes — Docker Architecture & Production Containers
- Health Probes & Graceful Shutdown: Kubernetes Lifecycles — Production Full-Stack Engineering
- Panics and Recover — Concurrent Systems Programming with Go
- Goroutines and Concurrent Execution — Concurrent Systems Programming with Go
- The select Statement — Concurrent Systems Programming with Go
- The context Package — Concurrent Systems Programming with Go
- Context Cancellation and Timeouts — Concurrent Systems Programming with Go
- Calling APIs with net/http Client — Concurrent Systems Programming with Go
- Graceful Shutdown on SIGTERM — Concurrent Systems Programming with Go
- Containerizing and Testing the Final Build — Concurrent Systems Programming with Go
- Signals, And What kill Really Sends — Linux Fundamentals & Systems Administration
- Job Control, And Processes That Outlive You — Linux Fundamentals & Systems Administration
- Close Phase & Signal Dispatch: Sockets & Teardown — Node.js Internals & Backend Services
- Production Hardening: Graceful Shutdown & Docker — Node.js Internals & Backend Services
- Recovering Root And Changing The Boot Loader — Red Hat Certified System Administrator (EX200) Exam Prep