Unix Signal
PronunciationYOO-niks SIG-nul
Definition
A Unix signal is a short message the operating system sends to a process. SIGTERM politely asks it to stop (it can clean up), SIGINT is Ctrl+C, and SIGKILL ends it immediately and can't be caught.
Where you hear it
In kill commands, Docker and Kubernetes shutdown behaviour (SIGTERM then SIGKILL) and graceful-shutdown code.
Examples
Handle SIGTERM so the app finishes in-flight requests before exiting.
Kubernetes sends SIGTERM, waits 30 seconds, then SIGKILL.
On deploy, the process receives SIGTERM and closes its connections before it exits.
Common mistake
Using kill -9 first. It gives the program no chance to save data or release locks; try SIGTERM first.
Don't confuse with
An exit code, which a process returns after it ends. A signal is sent to a running process.
Say it at work
- In a meeting or chat
Does the app handle SIGTERM?
- In an email or ticket
Exit code 137 means it was killed by SIGKILL.
Keep exploring
More in DevOps & Cloud