mariadb-clustercheck: ensure /var/log/kolla/mariadb exists

If mariadb-clustercheck starts before mariadb, the directory may not
exist, and the command fails.

This is necessary for the refactored MariaDB restart in
I5a12670d07077d24047aaff57ce8d33ccf7156ff.

Change-Id: Ie1b36eb9a403611c2f86aa4c1d500d324e5291f3
This commit is contained in:
Mark Goddard 2023-05-24 15:19:16 +01:00 committed by Michal Nasiadka
parent 600ed4f149
commit 9035251443
2 changed files with 15 additions and 0 deletions

View File

@ -5,5 +5,9 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% block mariadb_clustercheck_header %}{% endblock %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 644 /usr/local/bin/kolla_extend_start
{% block mariadb_clustercheck_footer %}{% endblock %}
{% block footer %}{% endblock %}

View File

@ -0,0 +1,11 @@
#!/bin/bash
: ${MARIADB_LOG_DIR:=/var/log/kolla/mariadb}
# Create log directory, with appropriate permissions
if [[ ! -d "${MARIADB_LOG_DIR}" ]]; then
mkdir -p ${MARIADB_LOG_DIR}
fi
if [[ $(stat -c %a ${MARIADB_LOG_DIR}) != "755" ]]; then
chmod 755 ${MARIADB_LOG_DIR}
fi