Skip to content

Instantly share code, notes, and snippets.

@teodorescuserban
Last active December 3, 2018 15:59
Show Gist options
  • Save teodorescuserban/a8d4f325329dad717acc104e1e710b1f to your computer and use it in GitHub Desktop.
Save teodorescuserban/a8d4f325329dad717acc104e1e710b1f to your computer and use it in GitHub Desktop.
tricking a s6-overlay driven nginx in docker to gracefully shutdown
# assuming the service is called nginx,
# to stop it gracefully
docker exec -it <container>
s6-svc -o /var/run/s6/services/nginx # puts the service in "run-once" mode
s6-svc -q /var/run/s6/services/nginx # sends the SIGQUIT signal required bby nginx for a graceful shutdown
# to start the service again
s6-svc -u /var/run/s6/services/nginx # puts the service back up in "run-always" mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment