
This commit conditionally allows the os_aodh role to install build and deploy within a venv. This is the new default behavior of the role however the functionality can be disabled. Change-Id: I9f9e09b2a68e843da1d92a782cd29fc563379a6d Implements: blueprint enable-venv-support-within-the-roles Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
48 lines
1.3 KiB
Django/Jinja
48 lines
1.3 KiB
Django/Jinja
# {{ ansible_managed }}
|
|
|
|
# vim:set ft=upstart ts=2 et:
|
|
|
|
description "{{ program_name }}"
|
|
author "Kevin Carter <kevin.carter@rackspace.com>"
|
|
|
|
start on runlevel [2345]
|
|
stop on runlelvel [016]
|
|
|
|
respawn
|
|
respawn limit 10 5
|
|
|
|
# Set the RUNBIN environment variable
|
|
env RUNBIN="{{ aodh_bin }}/{{ program_name }}"
|
|
|
|
# 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 }}"
|
|
|
|
{% if aodh_venv_enabled | bool -%}
|
|
. {{ aodh_bin }}/activate
|
|
{%- endif %}
|
|
|
|
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 \
|
|
--chuid {{ system_user }} \
|
|
--make-pidfile \
|
|
--pidfile /var/run/{{ program_name }}/{{ program_name }}.pid \
|
|
--exec "{{ program_override|default('$RUNBIN') }}" \
|
|
-- {{ program_config_options|default('') }} \
|
|
--log-file=/var/log/{{ service_name }}/{{ program_name }}.log
|
|
|