From c053dfd4a0551ef091ea45795d296854f0c1b454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20de=20Saint=20Martin?= Date: Wed, 13 Jun 2018 19:29:12 +0200 Subject: [PATCH 1/2] Graceful shutdown nginx and uwsgi. --- python2.7-alpine3.7/supervisord.ini | 2 ++ python2.7-alpine3.7/uwsgi.ini | 2 ++ python2.7/supervisord.conf | 2 ++ python2.7/uwsgi.ini | 2 ++ python3.5/supervisord.conf | 2 ++ python3.5/uwsgi.ini | 2 ++ python3.6-alpine3.7/supervisord.ini | 2 ++ python3.6-alpine3.7/uwsgi.ini | 2 ++ python3.6/supervisord.conf | 2 ++ python3.6/uwsgi.ini | 2 ++ 10 files changed, 20 insertions(+) diff --git a/python2.7-alpine3.7/supervisord.ini b/python2.7-alpine3.7/supervisord.ini index 9dfb06e..a7f9a11 100644 --- a/python2.7-alpine3.7/supervisord.ini +++ b/python2.7-alpine3.7/supervisord.ini @@ -14,3 +14,5 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 +# Graceful stop, see http://nginx.org/en/docs/control.html +stopsignal=QUIT diff --git a/python2.7-alpine3.7/uwsgi.ini b/python2.7-alpine3.7/uwsgi.ini index aef040c..5978b72 100644 --- a/python2.7-alpine3.7/uwsgi.ini +++ b/python2.7-alpine3.7/uwsgi.ini @@ -2,3 +2,5 @@ socket = /tmp/uwsgi.sock chown-socket = nginx:nginx chmod-socket = 664 +# Graceful shutdown on SIGTERM +hook-master-start = unix_signal:15 gracefully_kill_them_all \ No newline at end of file diff --git a/python2.7/supervisord.conf b/python2.7/supervisord.conf index a79e2e7..396cb38 100644 --- a/python2.7/supervisord.conf +++ b/python2.7/supervisord.conf @@ -14,3 +14,5 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 +# Graceful stop, see http://nginx.org/en/docs/control.html +stopsignal=QUIT diff --git a/python2.7/uwsgi.ini b/python2.7/uwsgi.ini index aef040c..5978b72 100644 --- a/python2.7/uwsgi.ini +++ b/python2.7/uwsgi.ini @@ -2,3 +2,5 @@ socket = /tmp/uwsgi.sock chown-socket = nginx:nginx chmod-socket = 664 +# Graceful shutdown on SIGTERM +hook-master-start = unix_signal:15 gracefully_kill_them_all \ No newline at end of file diff --git a/python3.5/supervisord.conf b/python3.5/supervisord.conf index a79e2e7..396cb38 100644 --- a/python3.5/supervisord.conf +++ b/python3.5/supervisord.conf @@ -14,3 +14,5 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 +# Graceful stop, see http://nginx.org/en/docs/control.html +stopsignal=QUIT diff --git a/python3.5/uwsgi.ini b/python3.5/uwsgi.ini index aef040c..5978b72 100644 --- a/python3.5/uwsgi.ini +++ b/python3.5/uwsgi.ini @@ -2,3 +2,5 @@ socket = /tmp/uwsgi.sock chown-socket = nginx:nginx chmod-socket = 664 +# Graceful shutdown on SIGTERM +hook-master-start = unix_signal:15 gracefully_kill_them_all \ No newline at end of file diff --git a/python3.6-alpine3.7/supervisord.ini b/python3.6-alpine3.7/supervisord.ini index 63b1e60..355a289 100644 --- a/python3.6-alpine3.7/supervisord.ini +++ b/python3.6-alpine3.7/supervisord.ini @@ -14,3 +14,5 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 +# Graceful stop, see http://nginx.org/en/docs/control.html +stopsignal=QUIT diff --git a/python3.6-alpine3.7/uwsgi.ini b/python3.6-alpine3.7/uwsgi.ini index aef040c..5978b72 100644 --- a/python3.6-alpine3.7/uwsgi.ini +++ b/python3.6-alpine3.7/uwsgi.ini @@ -2,3 +2,5 @@ socket = /tmp/uwsgi.sock chown-socket = nginx:nginx chmod-socket = 664 +# Graceful shutdown on SIGTERM +hook-master-start = unix_signal:15 gracefully_kill_them_all \ No newline at end of file diff --git a/python3.6/supervisord.conf b/python3.6/supervisord.conf index a79e2e7..396cb38 100644 --- a/python3.6/supervisord.conf +++ b/python3.6/supervisord.conf @@ -14,3 +14,5 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 +# Graceful stop, see http://nginx.org/en/docs/control.html +stopsignal=QUIT diff --git a/python3.6/uwsgi.ini b/python3.6/uwsgi.ini index aef040c..5978b72 100644 --- a/python3.6/uwsgi.ini +++ b/python3.6/uwsgi.ini @@ -2,3 +2,5 @@ socket = /tmp/uwsgi.sock chown-socket = nginx:nginx chmod-socket = 664 +# Graceful shutdown on SIGTERM +hook-master-start = unix_signal:15 gracefully_kill_them_all \ No newline at end of file From 870a7a01e3c5b2b57c204f8ade822bcca9495fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 22 Jun 2018 10:55:00 +0400 Subject: [PATCH 2/2] Add comments with reference to info in uWSGI configs --- python2.7-alpine3.7/uwsgi.ini | 2 +- python2.7/uwsgi.ini | 2 +- python3.5/uwsgi.ini | 2 +- python3.6-alpine3.7/uwsgi.ini | 2 +- python3.6/uwsgi.ini | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python2.7-alpine3.7/uwsgi.ini b/python2.7-alpine3.7/uwsgi.ini index 5978b72..e1d9f37 100644 --- a/python2.7-alpine3.7/uwsgi.ini +++ b/python2.7-alpine3.7/uwsgi.ini @@ -2,5 +2,5 @@ socket = /tmp/uwsgi.sock chown-socket = nginx:nginx chmod-socket = 664 -# Graceful shutdown on SIGTERM +# Graceful shutdown on SIGTERM, see https://github.com/unbit/uwsgi/issues/849#issuecomment-118869386 hook-master-start = unix_signal:15 gracefully_kill_them_all \ No newline at end of file diff --git a/python2.7/uwsgi.ini b/python2.7/uwsgi.ini index 5978b72..e1d9f37 100644 --- a/python2.7/uwsgi.ini +++ b/python2.7/uwsgi.ini @@ -2,5 +2,5 @@ socket = /tmp/uwsgi.sock chown-socket = nginx:nginx chmod-socket = 664 -# Graceful shutdown on SIGTERM +# Graceful shutdown on SIGTERM, see https://github.com/unbit/uwsgi/issues/849#issuecomment-118869386 hook-master-start = unix_signal:15 gracefully_kill_them_all \ No newline at end of file diff --git a/python3.5/uwsgi.ini b/python3.5/uwsgi.ini index 5978b72..e1d9f37 100644 --- a/python3.5/uwsgi.ini +++ b/python3.5/uwsgi.ini @@ -2,5 +2,5 @@ socket = /tmp/uwsgi.sock chown-socket = nginx:nginx chmod-socket = 664 -# Graceful shutdown on SIGTERM +# Graceful shutdown on SIGTERM, see https://github.com/unbit/uwsgi/issues/849#issuecomment-118869386 hook-master-start = unix_signal:15 gracefully_kill_them_all \ No newline at end of file diff --git a/python3.6-alpine3.7/uwsgi.ini b/python3.6-alpine3.7/uwsgi.ini index 5978b72..e1d9f37 100644 --- a/python3.6-alpine3.7/uwsgi.ini +++ b/python3.6-alpine3.7/uwsgi.ini @@ -2,5 +2,5 @@ socket = /tmp/uwsgi.sock chown-socket = nginx:nginx chmod-socket = 664 -# Graceful shutdown on SIGTERM +# Graceful shutdown on SIGTERM, see https://github.com/unbit/uwsgi/issues/849#issuecomment-118869386 hook-master-start = unix_signal:15 gracefully_kill_them_all \ No newline at end of file diff --git a/python3.6/uwsgi.ini b/python3.6/uwsgi.ini index 5978b72..e1d9f37 100644 --- a/python3.6/uwsgi.ini +++ b/python3.6/uwsgi.ini @@ -2,5 +2,5 @@ socket = /tmp/uwsgi.sock chown-socket = nginx:nginx chmod-socket = 664 -# Graceful shutdown on SIGTERM +# Graceful shutdown on SIGTERM, see https://github.com/unbit/uwsgi/issues/849#issuecomment-118869386 hook-master-start = unix_signal:15 gracefully_kill_them_all \ No newline at end of file