Fix reloads for uWSGI

uWSGI won't reload properly unless we use one of the built in options
for uWSGI reloads:

touch-reload
pidfile reload using uwsgi binary

This opts to use the pid file option, which uses the built in uWSGI
--reload option along with the "pidfile" option specified in the conf
file to reload the service.

Change-Id: I720011f3486fa5c1cf8cf8f5d826ca726930f751
This commit is contained in:
Andy McCrae 2017-08-15 15:48:11 +01:00
parent 323ea99323
commit 6b5a267065
2 changed files with 3 additions and 2 deletions

View File

@ -15,7 +15,7 @@ ExecStart={{ item.program_override }} {{ item.program_config_options | default('
{% else %}
ExecStart={{ nova_bin }}/{{ item.service_name }} {{ item.program_config_options | default('') }} {{ item.log_string | default('--log-file=') }}/var/log/nova/{{ item.service_name }}.log
{% endif %}
ExecReload=/bin/kill -HUP $MAINPID
ExecReload={{ (item.wsgi_app is defined and item.wsgi_app) | ternary(nova_bin + '/uwsgi --reload /var/run/' + item.service_name + '/' + item.service_name +'.pid','/bin/kill -HUP $MAINPID') }}
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=120

View File

@ -11,10 +11,11 @@ master = true
enable-threads = true
processes = {{ nova_wsgi_processes }}
threads = {{ nova_wsgi_threads }}
exit-on-reload = true
exit-on-reload = false
die-on-term = true
lazy-apps = true
add-header = Connection: close
buffer-size = {{ nova_wsgi_buffer_size }}
thunder-lock = true
logfile-chmod = 644
pidfile = /var/run/{{ item.service_name }}/{{ item.service_name }}.pid