SIGTERM
Polite request to terminate.
- Linux number
- 15
- FreeBSD number
- 15
- Default action
- Terminate the process
- Catch, block or ignore
- Allowed
- Standard
- POSIX.1-1990
The default signal for kill(1), and the one init systems and container runtimes send first. It can be caught, so a program can drain connections and flush state. Catching it and then ignoring it is how you earn the follow-up SIGKILL. In a container, PID 1 gets no default action for signals it has not installed a handler for, so a shell wrapper as PID 1 that never forwards SIGTERM is why docker stop takes ten seconds.
Compare it
- SIGTERM vs SIGKILL · Which one should stop a process?
Related syscalls
- pidfd_send_signal(2)Linux · Processes
Send a signal to the process a pidfd refers to, without PID-reuse races.
- signalfd(2)Linux · Events
Accept signals by reading a file descriptor instead of running a handler.
Rod on this
Sources
Numbers are Linux on x86 and arm64; alpha, mips, sparc and parisc number some signals differently. Spot one that's wrong? Tell Rod.