aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docker/aodh/aodh-api/extend_start.sh13
-rwxr-xr-xdocker/barbican/barbican-api/extend_start.sh14
-rw-r--r--docker/base/Dockerfile.j24
-rw-r--r--docker/base/httpd_setup.sh18
-rw-r--r--docker/cinder/cinder-api/extend_start.sh14
-rw-r--r--docker/cloudkitty/cloudkitty-api/extend_start.sh13
-rw-r--r--docker/gnocchi/gnocchi-api/extend_start.sh13
-rw-r--r--docker/heat/heat-api/extend_start.sh2
-rw-r--r--docker/heat/heat-base/extend_start.sh14
-rw-r--r--docker/horizon/extend_start.sh22
-rw-r--r--docker/ironic/ironic-api/extend_start.sh14
-rw-r--r--docker/ironic/ironic-pxe/extend_start.sh11
-rw-r--r--docker/keystone/keystone/extend_start.sh13
-rw-r--r--docker/manila/manila-api/extend_start.sh14
-rwxr-xr-xdocker/masakari/masakari-api/extend_start.sh13
-rw-r--r--docker/mistral/mistral-api/extend_start.sh14
-rw-r--r--docker/monasca/monasca-api/extend_start.sh13
-rw-r--r--docker/monasca/monasca-log-api/extend_start.sh13
-rw-r--r--docker/nova/nova-api/extend_start.sh14
-rw-r--r--docker/octavia/octavia-api/extend_start.sh14
-rw-r--r--docker/panko/panko-api/extend_start.sh13
-rw-r--r--docker/placement/placement-api/extend_start.sh11
-rw-r--r--docker/qinling/qinling-api/extend_start.sh13
-rw-r--r--docker/vitrage/vitrage-api/extend_start.sh13
-rwxr-xr-xdocker/zaqar/zaqar-wsgi/extend_start.sh14
-rw-r--r--docker/zun/zun-api/extend_start.sh13
26 files changed, 61 insertions, 276 deletions
diff --git a/docker/aodh/aodh-api/extend_start.sh b/docker/aodh/aodh-api/extend_start.sh
index 708b12ed3..07d4ce760 100644
--- a/docker/aodh/aodh-api/extend_start.sh
+++ b/docker/aodh/aodh-api/extend_start.sh
@@ -1,19 +1,10 @@
#!/bin/bash
-# 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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
-else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
-fi
-
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
aodh-dbsync
exit 0
fi
+
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/barbican/barbican-api/extend_start.sh b/docker/barbican/barbican-api/extend_start.sh
index 920b50804..317f7d7d6 100755
--- a/docker/barbican/barbican-api/extend_start.sh
+++ b/docker/barbican/barbican-api/extend_start.sh
@@ -7,16 +7,4 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
exit 0
fi
-# Assume the service runs on top of Apache when user is root
-if [[ "$(whoami)" == '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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
- else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
- fi
-fi
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2
index c1b4e1c06..5dc422e15 100644
--- a/docker/base/Dockerfile.j2
+++ b/docker/base/Dockerfile.j2
@@ -441,9 +441,9 @@ COPY set_configs.py /usr/local/bin/kolla_set_configs
{% if distro_python_version.startswith('3') %}
RUN sed -i -e "s+#\!/usr/bin/env python+#\!/usr/bin/env python3+g" /usr/local/bin/kolla_set_configs
{% endif %}
-
COPY start.sh /usr/local/bin/kolla_start
COPY copy_cacerts.sh /usr/local/bin/kolla_copy_cacerts
+COPY httpd_setup.sh /usr/local/bin/kolla_httpd_setup
COPY sudoers /etc/sudoers
COPY curlrc /root/.curlrc
@@ -461,7 +461,7 @@ ENTRYPOINT ["dumb-init", "--single-child", "--"]
{% endif %}
RUN touch /usr/local/bin/kolla_extend_start \
- && chmod 755 /usr/local/bin/kolla_start /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_set_configs /usr/local/bin/kolla_copy_cacerts \
+ && chmod 755 /usr/local/bin/kolla_start /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_set_configs /usr/local/bin/kolla_copy_cacerts /usr/local/bin/kolla_httpd_setup \
&& chmod 440 /etc/sudoers \
&& mkdir -p /var/log/kolla \
&& chown :kolla /var/log/kolla \
diff --git a/docker/base/httpd_setup.sh b/docker/base/httpd_setup.sh
new file mode 100644
index 000000000..990062e6d
--- /dev/null
+++ b/docker/base/httpd_setup.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# This script performs setup necessary to run the Apache httpd web server.
+# It should be sourced rather than executed as environment variables are set.
+
+# Assume the service runs on top of Apache httpd when user is root.
+if [[ "$(whoami)" == '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
+ install -d /var/run/apache2/
+ rm -rf /var/run/apache2/*
+ else
+ rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
+ fi
+fi
diff --git a/docker/cinder/cinder-api/extend_start.sh b/docker/cinder/cinder-api/extend_start.sh
index 251b9d105..cc0fd43f2 100644
--- a/docker/cinder/cinder-api/extend_start.sh
+++ b/docker/cinder/cinder-api/extend_start.sh
@@ -17,16 +17,4 @@ if [[ "${!KOLLA_OSM[@]}" ]]; then
exit 0
fi
-# Assume the service runs on top of Apache when user is root
-if [[ "$(whoami)" == '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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
- else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
- fi
-fi
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/cloudkitty/cloudkitty-api/extend_start.sh b/docker/cloudkitty/cloudkitty-api/extend_start.sh
index e1f41b558..2b144fa3f 100644
--- a/docker/cloudkitty/cloudkitty-api/extend_start.sh
+++ b/docker/cloudkitty/cloudkitty-api/extend_start.sh
@@ -1,16 +1,5 @@
#!/bin/bash
-# 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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
-else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
-fi
-
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
@@ -18,3 +7,5 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
cloudkitty-storage-init
exit 0
fi
+
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/gnocchi/gnocchi-api/extend_start.sh b/docker/gnocchi/gnocchi-api/extend_start.sh
index 5059551d2..84f33e103 100644
--- a/docker/gnocchi/gnocchi-api/extend_start.sh
+++ b/docker/gnocchi/gnocchi-api/extend_start.sh
@@ -1,19 +1,10 @@
#!/bin/bash
-# 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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
-else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
-fi
-
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
sudo -H -u gnocchi gnocchi-upgrade --log-file /var/log/kolla/gnocchi/gnocchi-upgrade.log
exit 0
fi
+
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/heat/heat-api/extend_start.sh b/docker/heat/heat-api/extend_start.sh
index be87c0923..8106cc51a 100644
--- a/docker/heat/heat-api/extend_start.sh
+++ b/docker/heat/heat-api/extend_start.sh
@@ -13,3 +13,5 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
fi
exit 0
fi
+
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/heat/heat-base/extend_start.sh b/docker/heat/heat-base/extend_start.sh
index 5af0ef36d..a73f17345 100644
--- a/docker/heat/heat-base/extend_start.sh
+++ b/docker/heat/heat-base/extend_start.sh
@@ -7,18 +7,4 @@ if [[ $(stat -c %a /var/log/kolla/heat) != "755" ]]; then
chmod 755 /var/log/kolla/heat
fi
-# Assume the service runs on top of Apache when user is root
-if [[ "$(whoami)" == '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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
- else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
- fi
-fi
-
. /usr/local/bin/kolla_heat_extend_start
diff --git a/docker/horizon/extend_start.sh b/docker/horizon/extend_start.sh
index a2bc79e13..a03ad5872 100644
--- a/docker/horizon/extend_start.sh
+++ b/docker/horizon/extend_start.sh
@@ -355,21 +355,6 @@ config_watcher_dashboard
config_zaqar_dashboard
config_zun_dashboard
-# 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
- install -d /var/run/apache2/
- if [[ "${KOLLA_BASE_DISTRO}" == "debian" ]] && [[ ${KOLLA_INSTALL_TYPE} == "binary" ]]; then
- APACHE_RUN_GROUP=horizon
- APACHE_RUN_USER=horizon
- fi
- rm -rf /var/run/apache2/*
-else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
-fi
-
if settings_changed; then
${MANAGE_PY} collectstatic --noinput --clear
${MANAGE_PY} compress --force
@@ -389,3 +374,10 @@ fi
if [[ -f ${SITE_PACKAGES}/openstack_dashboard/local/.secret_key_store ]] && [[ $(stat -c %U ${SITE_PACKAGES}/openstack_dashboard/local/.secret_key_store) != "horizon" ]]; then
chown horizon ${SITE_PACKAGES}/openstack_dashboard/local/.secret_key_store
fi
+
+. /usr/local/bin/kolla_httpd_setup
+
+if [[ "${KOLLA_BASE_DISTRO}" == "debian" ]] && [[ ${KOLLA_INSTALL_TYPE} == "binary" ]]; then
+ APACHE_RUN_GROUP=horizon
+ APACHE_RUN_USER=horizon
+fi
diff --git a/docker/ironic/ironic-api/extend_start.sh b/docker/ironic/ironic-api/extend_start.sh
index 20811158c..b03feb65d 100644
--- a/docker/ironic/ironic-api/extend_start.sh
+++ b/docker/ironic/ironic-api/extend_start.sh
@@ -18,16 +18,4 @@ if [[ "${!KOLLA_OSM[@]}" ]]; then
exit 0
fi
-# Assume the service runs on top of Apache when user is root
-if [[ "$(whoami)" == '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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
- else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
- fi
-fi
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/ironic/ironic-pxe/extend_start.sh b/docker/ironic/ironic-pxe/extend_start.sh
index db61fe0a2..ec7e2a7f3 100644
--- a/docker/ironic/ironic-pxe/extend_start.sh
+++ b/docker/ironic/ironic-pxe/extend_start.sh
@@ -40,13 +40,4 @@ if [[ "${ironic_arch}" =~ aarch64 ]]; then
fi
fi
-# 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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
-else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
-fi
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/keystone/keystone/extend_start.sh b/docker/keystone/keystone/extend_start.sh
index be6a0e1de..e428fc95e 100644
--- a/docker/keystone/keystone/extend_start.sh
+++ b/docker/keystone/keystone/extend_start.sh
@@ -1,16 +1,5 @@
#!/bin/bash
-# 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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
-else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
-fi
-
# Create log dir for Keystone logs
KEYSTONE_LOG_DIR="/var/log/kolla/keystone"
if [[ ! -d "${KEYSTONE_LOG_DIR}" ]]; then
@@ -56,4 +45,6 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
exit 0
fi
+. /usr/local/bin/kolla_httpd_setup
+
ARGS="-DFOREGROUND"
diff --git a/docker/manila/manila-api/extend_start.sh b/docker/manila/manila-api/extend_start.sh
index ea4a64f5f..925d5bf60 100644
--- a/docker/manila/manila-api/extend_start.sh
+++ b/docker/manila/manila-api/extend_start.sh
@@ -8,16 +8,4 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
exit 0
fi
-# Assume the service runs on top of Apache when user is root
-if [[ "$(whoami)" == '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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
- else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
- fi
-fi
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/masakari/masakari-api/extend_start.sh b/docker/masakari/masakari-api/extend_start.sh
index 1c372881d..0e0d917a2 100755
--- a/docker/masakari/masakari-api/extend_start.sh
+++ b/docker/masakari/masakari-api/extend_start.sh
@@ -1,19 +1,10 @@
#!/bin/bash
-# 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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
-else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
-fi
-
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
masakari-manage db sync
exit 0
fi
+
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/mistral/mistral-api/extend_start.sh b/docker/mistral/mistral-api/extend_start.sh
index 65e9db22c..149554191 100644
--- a/docker/mistral/mistral-api/extend_start.sh
+++ b/docker/mistral/mistral-api/extend_start.sh
@@ -8,16 +8,4 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
exit 0
fi
-# Assume the service runs on top of Apache when user is root
-if [[ "$(whoami)" == '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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
- else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
- fi
-fi
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/monasca/monasca-api/extend_start.sh b/docker/monasca/monasca-api/extend_start.sh
index f52868035..7f5802f15 100644
--- a/docker/monasca/monasca-api/extend_start.sh
+++ b/docker/monasca/monasca-api/extend_start.sh
@@ -9,17 +9,6 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
exit 0
fi
-# 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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
-else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
-fi
-
# When Apache first starts it writes out the custom log files with root
# ownership. This later prevents the Monasca API (which runs under the
# 'monasca' user) from updating them. To avoid this we create the log
@@ -33,3 +22,5 @@ for LOG_TYPE in error access; do
chown monasca:kolla ${MONASCA_API_LOG_DIR}/${SERVICE}-${LOG_TYPE}.log
fi
done
+
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/monasca/monasca-log-api/extend_start.sh b/docker/monasca/monasca-log-api/extend_start.sh
index d343ab26a..088ce5de1 100644
--- a/docker/monasca/monasca-log-api/extend_start.sh
+++ b/docker/monasca/monasca-log-api/extend_start.sh
@@ -2,17 +2,6 @@
SERVICE="monasca-log-api"
-# 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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
-else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
-fi
-
# When Apache first starts it writes out the custom log files with root
# ownership. This later prevents the Monasca Log API (which runs under the
# 'monasca' user) from updating them. To avoid this we create the log
@@ -26,3 +15,5 @@ for LOG_TYPE in error access; do
chown monasca:kolla ${MONASCA_LOG_API_LOG_DIR}/${SERVICE}-${LOG_TYPE}.log
fi
done
+
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/nova/nova-api/extend_start.sh b/docker/nova/nova-api/extend_start.sh
index 815b62255..aec89f621 100644
--- a/docker/nova/nova-api/extend_start.sh
+++ b/docker/nova/nova-api/extend_start.sh
@@ -24,16 +24,4 @@ if [[ "${!KOLLA_OSM[@]}" ]]; then
exit 0
fi
-# Assume the service runs on top of Apache when user is root
-if [[ "$(whoami)" == '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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
- else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
- fi
-fi
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/octavia/octavia-api/extend_start.sh b/docker/octavia/octavia-api/extend_start.sh
index d6cacba52..72bfe5775 100644
--- a/docker/octavia/octavia-api/extend_start.sh
+++ b/docker/octavia/octavia-api/extend_start.sh
@@ -7,16 +7,4 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
exit 0
fi
-# Assume the service runs on top of Apache when user is root
-if [[ "$(whoami)" == '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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
- else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
- fi
-fi
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/panko/panko-api/extend_start.sh b/docker/panko/panko-api/extend_start.sh
index 6cfb322eb..b7902e854 100644
--- a/docker/panko/panko-api/extend_start.sh
+++ b/docker/panko/panko-api/extend_start.sh
@@ -1,19 +1,10 @@
#!/bin/bash
-# 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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
-else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
-fi
-
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
panko-dbsync
exit 0
fi
+
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/placement/placement-api/extend_start.sh b/docker/placement/placement-api/extend_start.sh
index d91b8265c..0dd48948f 100644
--- a/docker/placement/placement-api/extend_start.sh
+++ b/docker/placement/placement-api/extend_start.sh
@@ -20,13 +20,4 @@ if [[ "${!KOLLA_OSM[@]}" ]]; then
exit 0
fi
-# 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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
-else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
-fi
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/qinling/qinling-api/extend_start.sh b/docker/qinling/qinling-api/extend_start.sh
index 2da76f0d6..3a7964c72 100644
--- a/docker/qinling/qinling-api/extend_start.sh
+++ b/docker/qinling/qinling-api/extend_start.sh
@@ -1,19 +1,10 @@
#!/bin/bash
-# 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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
-else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
-fi
-
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
qinling-db-manage upgrade head
exit 0
fi
+
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/vitrage/vitrage-api/extend_start.sh b/docker/vitrage/vitrage-api/extend_start.sh
index 0a6204ea5..7f1af9b46 100644
--- a/docker/vitrage/vitrage-api/extend_start.sh
+++ b/docker/vitrage/vitrage-api/extend_start.sh
@@ -1,17 +1,8 @@
#!/bin/bash
-# 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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
-else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
-fi
-
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
vitrage-dbsync
exit 0
fi
+
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/zaqar/zaqar-wsgi/extend_start.sh b/docker/zaqar/zaqar-wsgi/extend_start.sh
index 1277bea35..c55f0b199 100755
--- a/docker/zaqar/zaqar-wsgi/extend_start.sh
+++ b/docker/zaqar/zaqar-wsgi/extend_start.sh
@@ -1,15 +1,3 @@
#!/bin/bash
-# Assume the service runs on top of Apache when user is root
-if [[ "$(whoami)" == '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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
- else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
- fi
-fi
+. /usr/local/bin/kolla_httpd_setup
diff --git a/docker/zun/zun-api/extend_start.sh b/docker/zun/zun-api/extend_start.sh
index 6136e6b24..f21cc1bd3 100644
--- a/docker/zun/zun-api/extend_start.sh
+++ b/docker/zun/zun-api/extend_start.sh
@@ -1,19 +1,10 @@
#!/bin/bash
-# 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
- install -d /var/run/apache2/
- rm -rf /var/run/apache2/*
-else
- rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
-fi
-
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
zun-db-manage upgrade
exit 0
fi
+
+. /usr/local/bin/kolla_httpd_setup