Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Propagate SIGTERM for graceful shutdown
If the process receiving the signal is PID 1, it gets special treatment by the kernel; if it hasn't registered a handler for the signal, the kernel won't fall back to default behavior, and nothing happens. Since this script is PID 1 in the container, we need to explictly let shell register a SIGTERM handler and forward it to the main process so that `docker stop` will work properly when trying to gracefully shutdown the container. Note: currently, we only handles SIGTERM so that `docker stop` would properly. Long term, we should switch to some better init like dump-init (https://github.com/Yelp/dumb-init).
- Loading branch information