When an Apache + mod_wsgi configuration is not selected, configure the two Keystone services with uWSGI service profiles. Two arbitrary ports are selected for uWSGI to listen on, so that it may be proxied for by a dedicated web server. This is in preparation for laying down Nginx in a future patch. Notify events are updated to restart the Keystone uWSGI services where Keystone's configuration is modified only. Because federation concerns will be isolated within the dedicated web server, changes to federation configuration of Shiboleth do not trigger restarts of uWSGI. Similarly, SSL certificate changes do not trigger restarts. Change-Id: I99e16a999c496e68fb25fa2630d9b211c9755ea4 Related: blueprint keystone-uwsgi
45 lines
1.2 KiB
Django/Jinja
45 lines
1.2 KiB
Django/Jinja
# {{ ansible_managed }}
|
|
|
|
# vim:set ft=upstart ts=2 et:
|
|
|
|
description "{{ program_name }} under uWSGI"
|
|
author "Kevin Carter <kevin.carter@rackspace.com>"
|
|
|
|
start on runlevel [2345]
|
|
stop on runlevel [016]
|
|
|
|
respawn
|
|
respawn limit 10 5
|
|
|
|
# Set the RUNBIN environment variable
|
|
env RUNBIN="{{ keystone_bin }}/uwsgi"
|
|
|
|
# Change directory to service users home
|
|
chdir "{{ service_home }}"
|
|
|
|
# Pre start actions
|
|
pre-start script
|
|
mkdir -p "/var/run/{{ program_name }}"
|
|
chown {{ system_user }}:{{ system_group }} "/var/run/{{ program_name }}"
|
|
|
|
mkdir -p "/var/lock/{{ program_name }}"
|
|
chown {{ system_user }}:{{ system_group }} "/var/lock/{{ program_name }}"
|
|
|
|
. {{ keystone_bin }}/activate
|
|
|
|
end script
|
|
|
|
# Post stop actions
|
|
post-stop script
|
|
rm "/var/run/{{ program_name }}/{{ program_name }}.pid"
|
|
end script
|
|
|
|
# Run the start up job
|
|
exec start-stop-daemon --start \
|
|
--make-pidfile \
|
|
--pidfile /var/run/{{ program_name }}/{{ program_name }}.pid \
|
|
--exec "{{ program_override|default('$RUNBIN') }}" \
|
|
-- --ini "/etc/uwsgi/{{ program_name }}.ini" \
|
|
--logto /var/log/keystone/{{ program_name }}.log \
|
|
-- {{ program_config_options|default('') }}
|