diff options
| author | Jenkins <jenkins@review.openstack.org> | 2017-05-03 14:19:38 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2017-05-03 14:19:38 +0000 |
| commit | 72c76f3071cac433daea8ede65df24ce4a8f8660 (patch) | |
| tree | 9d4cb9dc977008bf4040945b286a40460ebd6b5a | |
| parent | 60f6be26456209aaf1fe502c358a66e5efbbd6f2 (diff) | |
| parent | a2c0087b3842c00e27440e69abc3c57125a50cc0 (diff) | |
| download | kolla-72c76f3071cac433daea8ede65df24ce4a8f8660.tar.gz kolla-72c76f3071cac433daea8ede65df24ce4a8f8660.zip | |
Merge "Add Apache packages to zaqar container"
| -rwxr-xr-x | docker/zaqar/Dockerfile.j2 | 49 | ||||
| -rwxr-xr-x | docker/zaqar/extend_start.sh | 13 |
2 files changed, 54 insertions, 8 deletions
diff --git a/docker/zaqar/Dockerfile.j2 b/docker/zaqar/Dockerfile.j2 index b17ffdd08..eeac2eef1 100755 --- a/docker/zaqar/Dockerfile.j2 +++ b/docker/zaqar/Dockerfile.j2 @@ -9,17 +9,50 @@ LABEL maintainer="{{ maintainer }}" {% if install_type == 'binary' %} - {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} - {% set zaqar_packages = ['openstack-zaqar'] %} - {% elif base_distro in ['debian', 'ubuntu'] %} - {% set zaqar_packages = [ - 'zaqar-common', - 'zaqar-server' - ] %} - {% endif %} +{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + {% set zaqar_packages = [ + 'httpd', + 'mod_ssl', + 'mod_wsgi', + 'openstack-zaqar' + ] %} {{ macros.install_packages(zaqar_packages | customizable("packages")) }} +RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \ + && sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf +{% elif base_distro in ['debian', 'ubuntu'] %} + {% set zaqar_packages = [ + 'apache2', + 'libapache2-mod-wsgi' + 'zaqar-common', + 'zaqar-server' + ] %} +{{ macros.install_packages(zaqar_packages | customizable("packages")) }} +RUN echo > /etc/apache2/ports.conf +{% endif %} {% elif install_type == 'source' %} +{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + + {% set zaqar_packages = [ + 'httpd', + 'mod_ssl', + 'mod_wsgi' + ] %} +{{ macros.install_packages(zaqar_packages | customizable("packages")) }} +RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \ + && sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf + +{% elif base_distro in ['debian', 'ubuntu'] %} + + {% set zaqar_packages = [ + 'apache2', + 'libapache2-mod-wsgi' + ] %} + +{{ macros.install_packages(zaqar_packages | customizable("packages")) }} +RUN echo > /etc/apache2/ports.conf +{% endif %} + ADD zaqar-archive /zaqar-source {% set zaqar_pip_packages = [ diff --git a/docker/zaqar/extend_start.sh b/docker/zaqar/extend_start.sh index b7ce7bb04..e0fb2142e 100755 --- a/docker/zaqar/extend_start.sh +++ b/docker/zaqar/extend_start.sh @@ -6,3 +6,16 @@ fi if [[ $(stat -c %a /var/log/kolla/zaqar) != "755" ]]; then chmod 755 /var/log/kolla/zaqar fi + +# Assume the service runs on top of Apache when user is root +if [[ $USER == 'root' ]]; then + # NOTE(pbourke): httpd will not clean up after itself in some cases which + # results in the container not being able to restart. (bug #1489676, 1557036) + if [[ "${KOLLA_BASE_DISTRO}" =~ debian|ubuntu ]]; then + # Loading Apache2 ENV variables + . /etc/apache2/envvars + rm -rf /var/run/apache2/* + else + rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd* + fi +fi |
