openstack-ansible-os_glance/templates/glance-upstart-init.j2
Jimmy McCrory e03b37d610 Only install to virtual environment
Remove all tasks and variables related to toggling between installation
of glance inside or outside of a Python virtual environment.
Installing within a venv is now the only supported deployment.

Additionally, a few changes have been made to make the creation of the
venv more resistant to interruptions during a run of the role.
* unarchiving a pre-built venv will now also occur when the venv
  directory is created, not only after being downloaded
* virtualenv-tools is run against both pre-built and non pre-built venvs
  to account for interruptions during or prior to unarchiving

Change-Id: Icfdfe3a6d47413875a49af3c38537fbd342bc16a
Implements: blueprint only-install-venvs
2016-07-07 18:22:19 +00:00

43 lines
1.2 KiB
Django/Jinja

# {{ ansible_managed }}
description "{{ program_name }}"
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="{{ glance_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 }}"
. {{ glance_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 \
--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/glance/{{ program_name }}.log