From 0999b7e4d67d433e0ff350c2543ba596ffc380bd Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Mon, 17 Jul 2023 11:53:44 +1000 Subject: [PATCH] MDEV-31714: remove mysqld/mariadb_safe.cnf file The 50-mariadb_safe.cnf file exposed a syslog configuration that got picked up by Galera SST scripts. These would push output to /dev/log which doesn't exist in containers. --- 10.10/Dockerfile | 2 +- 10.11/Dockerfile | 2 +- 10.4/Dockerfile | 2 +- 10.5/Dockerfile | 2 +- 10.6/Dockerfile | 2 +- 10.9/Dockerfile | 2 +- 11.0/Dockerfile | 2 +- 11.1/Dockerfile | 2 +- 11.2/Dockerfile | 2 +- Dockerfile.template | 2 +- update.sh | 3 +++ 11 files changed, 13 insertions(+), 10 deletions(-) diff --git a/10.10/Dockerfile b/10.10/Dockerfile index 1e59152..58adae6 100644 --- a/10.10/Dockerfile +++ b/10.10/Dockerfile @@ -114,7 +114,7 @@ RUN set -ex; \ ; \ rm -rf /var/lib/apt/lists/*; \ # purge and re-create /var/lib/mysql with appropriate ownership - rm -rf /var/lib/mysql; \ + rm -rf /var/lib/mysql /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf; \ mkdir -p /var/lib/mysql /var/run/mysqld; \ chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \ # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime diff --git a/10.11/Dockerfile b/10.11/Dockerfile index b7d8a8d..df7acc0 100644 --- a/10.11/Dockerfile +++ b/10.11/Dockerfile @@ -114,7 +114,7 @@ RUN set -ex; \ ; \ rm -rf /var/lib/apt/lists/*; \ # purge and re-create /var/lib/mysql with appropriate ownership - rm -rf /var/lib/mysql; \ + rm -rf /var/lib/mysql /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf; \ mkdir -p /var/lib/mysql /var/run/mysqld; \ chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \ # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime diff --git a/10.4/Dockerfile b/10.4/Dockerfile index 9e04ecf..68f4b50 100644 --- a/10.4/Dockerfile +++ b/10.4/Dockerfile @@ -116,7 +116,7 @@ RUN set -ex; \ ; \ rm -rf /var/lib/apt/lists/*; \ # purge and re-create /var/lib/mysql with appropriate ownership - rm -rf /var/lib/mysql; \ + rm -rf /var/lib/mysql /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf; \ mkdir -p /var/lib/mysql /var/run/mysqld; \ chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \ # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime diff --git a/10.5/Dockerfile b/10.5/Dockerfile index 7c83f40..fdf688b 100644 --- a/10.5/Dockerfile +++ b/10.5/Dockerfile @@ -116,7 +116,7 @@ RUN set -ex; \ ; \ rm -rf /var/lib/apt/lists/*; \ # purge and re-create /var/lib/mysql with appropriate ownership - rm -rf /var/lib/mysql; \ + rm -rf /var/lib/mysql /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf; \ mkdir -p /var/lib/mysql /var/run/mysqld; \ chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \ # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime diff --git a/10.6/Dockerfile b/10.6/Dockerfile index b142f1e..275089a 100644 --- a/10.6/Dockerfile +++ b/10.6/Dockerfile @@ -116,7 +116,7 @@ RUN set -ex; \ ; \ rm -rf /var/lib/apt/lists/*; \ # purge and re-create /var/lib/mysql with appropriate ownership - rm -rf /var/lib/mysql; \ + rm -rf /var/lib/mysql /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf; \ mkdir -p /var/lib/mysql /var/run/mysqld; \ chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \ # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime diff --git a/10.9/Dockerfile b/10.9/Dockerfile index 69cbdbc..953a10c 100644 --- a/10.9/Dockerfile +++ b/10.9/Dockerfile @@ -114,7 +114,7 @@ RUN set -ex; \ ; \ rm -rf /var/lib/apt/lists/*; \ # purge and re-create /var/lib/mysql with appropriate ownership - rm -rf /var/lib/mysql; \ + rm -rf /var/lib/mysql /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf; \ mkdir -p /var/lib/mysql /var/run/mysqld; \ chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \ # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 5b2637d..21a80e8 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -114,7 +114,7 @@ RUN set -ex; \ ; \ rm -rf /var/lib/apt/lists/*; \ # purge and re-create /var/lib/mysql with appropriate ownership - rm -rf /var/lib/mysql; \ + rm -rf /var/lib/mysql /etc/mysql/mariadb.conf.d/50-mariadb_safe.cnf; \ mkdir -p /var/lib/mysql /var/run/mysqld; \ chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \ # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime diff --git a/11.1/Dockerfile b/11.1/Dockerfile index 18eae01..4fce2d5 100644 --- a/11.1/Dockerfile +++ b/11.1/Dockerfile @@ -114,7 +114,7 @@ RUN set -ex; \ ; \ rm -rf /var/lib/apt/lists/*; \ # purge and re-create /var/lib/mysql with appropriate ownership - rm -rf /var/lib/mysql; \ + rm -rf /var/lib/mysql /etc/mysql/mariadb.conf.d/50-mariadb_safe.cnf; \ mkdir -p /var/lib/mysql /var/run/mysqld; \ chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \ # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime diff --git a/11.2/Dockerfile b/11.2/Dockerfile index e968072..b90420f 100644 --- a/11.2/Dockerfile +++ b/11.2/Dockerfile @@ -114,7 +114,7 @@ RUN set -ex; \ ; \ rm -rf /var/lib/apt/lists/*; \ # purge and re-create /var/lib/mysql with appropriate ownership - rm -rf /var/lib/mysql; \ + rm -rf /var/lib/mysql /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf; \ mkdir -p /var/lib/mysql /var/run/mysqld; \ chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \ # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime diff --git a/Dockerfile.template b/Dockerfile.template index 7362876..37cd721 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -116,7 +116,7 @@ RUN set -ex; \ ; \ rm -rf /var/lib/apt/lists/*; \ # purge and re-create /var/lib/mysql with appropriate ownership - rm -rf /var/lib/mysql; \ + rm -rf /var/lib/mysql /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf; \ mkdir -p /var/lib/mysql /var/run/mysqld; \ chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \ # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime diff --git a/update.sh b/update.sh index 36e4b45..b0eb27a 100755 --- a/update.sh +++ b/update.sh @@ -93,6 +93,9 @@ update_version() sed -i -e 's/mysql_upgrade_info/mariadb_upgrade_info/' \ "$version/docker-entrypoint.sh" "$version/healthcheck.sh" fi + if [[ $version =~ 11.[01] ]]; then + sed -i -e 's/50-mysqld_safe.cnf/50-mariadb_safe.cnf/' "$version/Dockerfile" + fi ;& esac