github.com/smintz/nomad@v0.8.3/website/source/guides/operating-a-job/update-strategies/handling-signals.html.md (about) 1 --- 2 layout: "guides" 3 page_title: "Handling Signals - Operating a Job" 4 sidebar_current: "guides-operating-a-job-updating-handling-signals" 5 description: |- 6 Well-behaved applications expose a way to perform cleanup prior to exiting. 7 Nomad can optionally send a configurable signal to applications before 8 killing them, allowing them to drain connections or gracefully terminate. 9 --- 10 11 # Handling Signals 12 13 On operating systems that support signals, Nomad will send the application a 14 configurable signal before killing it. This gives the application time to 15 gracefully drain connections and conduct other cleanup before shutting down. 16 Certain applications take longer to drain than others, and thus Nomad allows 17 specifying the amount of time to wait for the application to exit before 18 force-killing it. 19 20 Before Nomad terminates an application, it will send the `SIGINT` signal to the 21 process. Processes running under Nomad should respond to this signal to 22 gracefully drain connections. After a configurable timeout, the application 23 will be force-terminated. 24 25 For more details on the `kill_timeout` option, please see the 26 [job specification documentation](/docs/job-specification/task.html#kill_timeout). 27 28 ```hcl 29 job "docs" { 30 group "example" { 31 task "server" { 32 # ... 33 kill_timeout = "45s" 34 } 35 } 36 } 37 ``` 38 39 The behavior is slightly different for Docker-based tasks. Nomad will run the 40 `docker stop` command with the specified `kill_timeout`. The signal that `docker 41 stop` sends to your container entrypoint is configurable using the 42 [`STOPSIGNAL` configuration directive] 43 (https://docs.docker.com/engine/reference/builder/#stopsignal), however please 44 note that the default is `SIGTERM`.