From 4abcfaa86e7bb8827bc1b8b0e48352a0b748446f Mon Sep 17 00:00:00 2001 From: Brant Knudson Date: Fri, 11 Mar 2016 08:30:05 -0600 Subject: [PATCH] uwsgi keystone under master process Normally a standalone uwsgi server would run in "master" mode -- it handles signals to reload the processes. I tried this originally with keystone but found that the server didn't shut down when unstacking. The reason it didn't shut down is because (by default) uwsgi does a reload on SIGTERM & SIGHUP rather than shutting down by default, see [1]. Setting "die-on-term = true" & "exit-on-reload = true" changes the uwsgi server to shut down when unstacking. [1] http://uwsgi-docs.readthedocs.org/en/latest/Management.html#reloading-the-server Change-Id: I145fef185d4a31078295941779e175b7452a5760 --- lib/keystone | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/keystone b/lib/keystone index 12bcee8eee..7743a64201 100644 --- a/lib/keystone +++ b/lib/keystone @@ -310,6 +310,11 @@ function configure_keystone { # Common settings for file in "$KEYSTONE_PUBLIC_UWSGI_FILE" "$KEYSTONE_ADMIN_UWSGI_FILE"; do + # This is running standalone + iniset "$file" uwsgi master true + # Set die-on-term & exit-on-reload so that uwsgi shuts down + iniset "$file" uwsgi die-on-term true + iniset "$file" uwsgi exit-on-reload true iniset "$file" uwsgi enable-threads true iniset "$file" uwsgi plugins python # uwsgi recommends this to prevent thundering herd on accept.