Fix cinder-api ubuntu binary

This changes moves cinder-api to make use of apache to launch
its processes.
Ubuntu binary removed support in Ocata for cinder-api system
services [1].
At this moment cinder in Ocata branch is not working at all
due this issue.
This changes aims to fix cinder in master only for ubuntu binary
with the purpose of make a clean backport to stable/ocata without
do any other change on the backport process.

A follow up change will migrate other OS/install_type to make use of
Apache but only changing master branch.

[1] http://lists.openstack.org/pipermail/openstack-dev/2017-January/111069.html

Change-Id: I86ae3ec899e9b7b1ad9f727b9b9bb3549738f944
Closes-Bug: #1676751
This commit is contained in:
Eduardo Gonzalez 2017-04-19 10:46:58 +01:00
parent 1cad4813b6
commit d14aadd65d
2 changed files with 20 additions and 1 deletions

View File

@ -23,7 +23,9 @@ RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
'libapache2-mod-wsgi'
] %}
{{ macros.install_packages(cinder_api_packages | customizable("packages")) }}
RUN echo > /etc/apache2/ports.conf
RUN mkdir -p /var/www/cgi-bin/cinder \
&& cp -a /usr/bin/cinder-wsgi /var/www/cgi-bin/cinder/cinder-wsgi \
&& echo > /etc/apache2/ports.conf
{% endif %}
{% elif install_type == 'source' %}
@ -53,4 +55,9 @@ RUN chmod 755 /usr/local/bin/kolla_cinder_extend_start
{% block cinder_api_footer %}{% endblock %}
{% block footer %}{% endblock %}
{% if install_type == 'binary' and base_distro in ['debian', 'ubuntu'] %}
RUN chown -R cinder: /var/www/cgi-bin/cinder \
&& chmod 755 /var/www/cgi-bin/cinder/cinder-wsgi
{% else %}
USER cinder
{% endif %}

View File

@ -7,3 +7,15 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
cinder-manage db sync
exit 0
fi
if [[ "${KOLLA_INSTALL_TYPE}" == "binary" ]]; then
if [[ "${KOLLA_BASE_DISTRO}" =~ debian|ubuntu ]]; then
# Loading Apache2 ENV variables
. /etc/apache2/envvars
rm -rf /var/run/apache2/*
APACHE_DIR="apache2"
else
rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
APACHE_DIR="httpd"
fi
fi