diff --git a/scripts/runmariadb b/scripts/runmariadb index 0ae6d9692..88de3436e 100755 --- a/scripts/runmariadb +++ b/scripts/runmariadb @@ -18,6 +18,13 @@ fi ln -sf /proc/self/fd/1 /var/log/mariadb/mariadb.log +# Restart mysqld when the certificate is updated +if [ "$IRONIC_TLS_SETUP" == "true" ]; then + inotifywait -m -e delete_self "${MARIADB_CERT_FILE}" | while read file event; do + kill $(pgrep mysqld) + done & +fi + if [ ! -d "${DATADIR}/mysql" ]; then crudini --set "$MARIADB_CONF_FILE" mysqld max_connections 64 crudini --set "$MARIADB_CONF_FILE" mysqld max_heap_table_size 1M @@ -44,7 +51,6 @@ DROP DATABASE IF EXISTS test ; CREATE DATABASE IF NOT EXISTS ironic ; FLUSH PRIVILEGES ; EOSQL - # mysqld_safe closes stdout/stderr if no bash options are set ($- == '') # turn on tracing to prevent this exec bash -x /usr/bin/mysqld_safe --init-file /tmp/configure-mysql.sql