Fix potential Monasca-thresh start failure

Monasca-thresh inherits from the Storm container, but we want
it to write logs to the Monasca logs directory. In this commit
we overwrite the script which configures the Storm log directory
with the Monasca script.

Change-Id: Id961134e424117ebefb088021faaf37fa02757d7
Partially-Implements: blueprint monasca-containers
This commit is contained in:
Doug Szumski 2018-10-01 17:09:41 +01:00
parent 2743931fe3
commit a13b4fbfcf
2 changed files with 20 additions and 0 deletions

View File

@ -64,6 +64,11 @@ RUN cd /monasca-common-source/java \
{% endif %}
# Overwrite the script inherited from Storm
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN touch /usr/local/bin/kolla_monasca_extend_start \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_monasca_extend_start
{% block monasca_thresh_footer %}{% endblock %}
{% block footer %}{% endblock %}

View File

@ -0,0 +1,15 @@
#!/bin/bash
# Create log directory, with appropriate permissions
MONASCA_LOG_DIR="/var/log/kolla/monasca"
if [[ ! -d "$MONASCA_LOG_DIR" ]]; then
mkdir -p $MONASCA_LOG_DIR
fi
if [[ $(stat -c %U:%G ${MONASCA_LOG_DIR}) != "monasca:kolla" ]]; then
chown monasca:kolla ${MONASCA_LOG_DIR}
fi
if [[ $(stat -c %a ${MONASCA_LOG_DIR}) != "755" ]]; then
chmod 755 ${MONASCA_LOG_DIR}
fi
. /usr/local/bin/kolla_monasca_extend_start