From 76b7b9e8768d58cfc4c9a9a72843613d4d116119 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Mon, 10 Jun 2024 20:55:53 +1000 Subject: [PATCH] Skip ssl on docker_temp_server_start And checking it when seeing if the server is started. Closes: #592 --- 10.11-ubi/docker-entrypoint.sh | 6 ++++-- 10.11/docker-entrypoint.sh | 6 ++++-- 10.4/docker-entrypoint.sh | 6 ++++-- 10.5/docker-entrypoint.sh | 6 ++++-- 10.6-ubi/docker-entrypoint.sh | 6 ++++-- 10.6/docker-entrypoint.sh | 6 ++++-- 11.1/docker-entrypoint.sh | 6 ++++-- 11.2/docker-entrypoint.sh | 6 ++++-- 11.4-ubi/docker-entrypoint.sh | 8 ++++++-- 11.4/docker-entrypoint.sh | 8 ++++++-- 11.5-ubi/docker-entrypoint.sh | 8 ++++++-- 11.5/docker-entrypoint.sh | 8 ++++++-- docker-entrypoint.sh | 8 ++++++-- update.sh | 5 +++++ 14 files changed, 67 insertions(+), 26 deletions(-) diff --git a/10.11-ubi/docker-entrypoint.sh b/10.11-ubi/docker-entrypoint.sh index 6e50e1c0..4af730a2 100755 --- a/10.11-ubi/docker-entrypoint.sh +++ b/10.11-ubi/docker-entrypoint.sh @@ -121,7 +121,8 @@ mysql_get_config() { docker_temp_server_start() { "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ --expire-logs-days=0 \ - --loose-innodb_buffer_pool_load_at_startup=0 & + --loose-innodb_buffer_pool_load_at_startup=0 \ + & declare -g MARIADB_PID MARIADB_PID=$! mysql_note "Waiting for server startup" @@ -133,7 +134,8 @@ docker_temp_server_start() { fi local i for i in {30..0}; do - if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then + if docker_process_sql "${extraArgs[@]}" --database=mysql \ + <<<'SELECT 1' &> /dev/null; then break fi sleep 1 diff --git a/10.11/docker-entrypoint.sh b/10.11/docker-entrypoint.sh index 6e50e1c0..4af730a2 100755 --- a/10.11/docker-entrypoint.sh +++ b/10.11/docker-entrypoint.sh @@ -121,7 +121,8 @@ mysql_get_config() { docker_temp_server_start() { "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ --expire-logs-days=0 \ - --loose-innodb_buffer_pool_load_at_startup=0 & + --loose-innodb_buffer_pool_load_at_startup=0 \ + & declare -g MARIADB_PID MARIADB_PID=$! mysql_note "Waiting for server startup" @@ -133,7 +134,8 @@ docker_temp_server_start() { fi local i for i in {30..0}; do - if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then + if docker_process_sql "${extraArgs[@]}" --database=mysql \ + <<<'SELECT 1' &> /dev/null; then break fi sleep 1 diff --git a/10.4/docker-entrypoint.sh b/10.4/docker-entrypoint.sh index 85110e81..ab540da0 100755 --- a/10.4/docker-entrypoint.sh +++ b/10.4/docker-entrypoint.sh @@ -121,7 +121,8 @@ mysql_get_config() { docker_temp_server_start() { "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ --expire-logs-days=0 \ - --loose-innodb_buffer_pool_load_at_startup=0 & + --loose-innodb_buffer_pool_load_at_startup=0 \ + & declare -g MARIADB_PID MARIADB_PID=$! mysql_note "Waiting for server startup" @@ -133,7 +134,8 @@ docker_temp_server_start() { fi local i for i in {30..0}; do - if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then + if docker_process_sql "${extraArgs[@]}" --database=mysql \ + <<<'SELECT 1' &> /dev/null; then break fi sleep 1 diff --git a/10.5/docker-entrypoint.sh b/10.5/docker-entrypoint.sh index f6c5dd5b..07e1ab4a 100755 --- a/10.5/docker-entrypoint.sh +++ b/10.5/docker-entrypoint.sh @@ -121,7 +121,8 @@ mysql_get_config() { docker_temp_server_start() { "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ --expire-logs-days=0 \ - --loose-innodb_buffer_pool_load_at_startup=0 & + --loose-innodb_buffer_pool_load_at_startup=0 \ + & declare -g MARIADB_PID MARIADB_PID=$! mysql_note "Waiting for server startup" @@ -133,7 +134,8 @@ docker_temp_server_start() { fi local i for i in {30..0}; do - if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then + if docker_process_sql "${extraArgs[@]}" --database=mysql \ + <<<'SELECT 1' &> /dev/null; then break fi sleep 1 diff --git a/10.6-ubi/docker-entrypoint.sh b/10.6-ubi/docker-entrypoint.sh index 4738c6a9..fb0cc6c9 100755 --- a/10.6-ubi/docker-entrypoint.sh +++ b/10.6-ubi/docker-entrypoint.sh @@ -121,7 +121,8 @@ mysql_get_config() { docker_temp_server_start() { "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ --expire-logs-days=0 \ - --loose-innodb_buffer_pool_load_at_startup=0 & + --loose-innodb_buffer_pool_load_at_startup=0 \ + & declare -g MARIADB_PID MARIADB_PID=$! mysql_note "Waiting for server startup" @@ -133,7 +134,8 @@ docker_temp_server_start() { fi local i for i in {30..0}; do - if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then + if docker_process_sql "${extraArgs[@]}" --database=mysql \ + <<<'SELECT 1' &> /dev/null; then break fi sleep 1 diff --git a/10.6/docker-entrypoint.sh b/10.6/docker-entrypoint.sh index 4738c6a9..fb0cc6c9 100755 --- a/10.6/docker-entrypoint.sh +++ b/10.6/docker-entrypoint.sh @@ -121,7 +121,8 @@ mysql_get_config() { docker_temp_server_start() { "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ --expire-logs-days=0 \ - --loose-innodb_buffer_pool_load_at_startup=0 & + --loose-innodb_buffer_pool_load_at_startup=0 \ + & declare -g MARIADB_PID MARIADB_PID=$! mysql_note "Waiting for server startup" @@ -133,7 +134,8 @@ docker_temp_server_start() { fi local i for i in {30..0}; do - if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then + if docker_process_sql "${extraArgs[@]}" --database=mysql \ + <<<'SELECT 1' &> /dev/null; then break fi sleep 1 diff --git a/11.1/docker-entrypoint.sh b/11.1/docker-entrypoint.sh index 8e15ea0a..1495de69 100755 --- a/11.1/docker-entrypoint.sh +++ b/11.1/docker-entrypoint.sh @@ -121,7 +121,8 @@ mysql_get_config() { docker_temp_server_start() { "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ --expire-logs-days=0 \ - --loose-innodb_buffer_pool_load_at_startup=0 & + --loose-innodb_buffer_pool_load_at_startup=0 \ + & declare -g MARIADB_PID MARIADB_PID=$! mysql_note "Waiting for server startup" @@ -133,7 +134,8 @@ docker_temp_server_start() { fi local i for i in {30..0}; do - if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then + if docker_process_sql "${extraArgs[@]}" --database=mysql \ + <<<'SELECT 1' &> /dev/null; then break fi sleep 1 diff --git a/11.2/docker-entrypoint.sh b/11.2/docker-entrypoint.sh index e41ed9c7..5e89cc74 100755 --- a/11.2/docker-entrypoint.sh +++ b/11.2/docker-entrypoint.sh @@ -121,7 +121,8 @@ mysql_get_config() { docker_temp_server_start() { "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ --expire-logs-days=0 \ - --loose-innodb_buffer_pool_load_at_startup=0 & + --loose-innodb_buffer_pool_load_at_startup=0 \ + & declare -g MARIADB_PID MARIADB_PID=$! mysql_note "Waiting for server startup" @@ -133,7 +134,8 @@ docker_temp_server_start() { fi local i for i in {30..0}; do - if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then + if docker_process_sql "${extraArgs[@]}" --database=mysql \ + <<<'SELECT 1' &> /dev/null; then break fi sleep 1 diff --git a/11.4-ubi/docker-entrypoint.sh b/11.4-ubi/docker-entrypoint.sh index e5b4aa9a..eb13c844 100755 --- a/11.4-ubi/docker-entrypoint.sh +++ b/11.4-ubi/docker-entrypoint.sh @@ -121,7 +121,9 @@ mysql_get_config() { docker_temp_server_start() { "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ --expire-logs-days=0 \ - --loose-innodb_buffer_pool_load_at_startup=0 & + --loose-innodb_buffer_pool_load_at_startup=0 \ + --skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \ + & declare -g MARIADB_PID MARIADB_PID=$! mysql_note "Waiting for server startup" @@ -133,7 +135,9 @@ docker_temp_server_start() { fi local i for i in {30..0}; do - if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then + if docker_process_sql "${extraArgs[@]}" --database=mysql \ + --skip-ssl --skip-ssl-verify-server-cert \ + <<<'SELECT 1' &> /dev/null; then break fi sleep 1 diff --git a/11.4/docker-entrypoint.sh b/11.4/docker-entrypoint.sh index e5b4aa9a..eb13c844 100755 --- a/11.4/docker-entrypoint.sh +++ b/11.4/docker-entrypoint.sh @@ -121,7 +121,9 @@ mysql_get_config() { docker_temp_server_start() { "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ --expire-logs-days=0 \ - --loose-innodb_buffer_pool_load_at_startup=0 & + --loose-innodb_buffer_pool_load_at_startup=0 \ + --skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \ + & declare -g MARIADB_PID MARIADB_PID=$! mysql_note "Waiting for server startup" @@ -133,7 +135,9 @@ docker_temp_server_start() { fi local i for i in {30..0}; do - if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then + if docker_process_sql "${extraArgs[@]}" --database=mysql \ + --skip-ssl --skip-ssl-verify-server-cert \ + <<<'SELECT 1' &> /dev/null; then break fi sleep 1 diff --git a/11.5-ubi/docker-entrypoint.sh b/11.5-ubi/docker-entrypoint.sh index d8d705a2..fa35d577 100755 --- a/11.5-ubi/docker-entrypoint.sh +++ b/11.5-ubi/docker-entrypoint.sh @@ -121,7 +121,9 @@ mysql_get_config() { docker_temp_server_start() { "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ --expire-logs-days=0 \ - --loose-innodb_buffer_pool_load_at_startup=0 & + --loose-innodb_buffer_pool_load_at_startup=0 \ + --skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \ + & declare -g MARIADB_PID MARIADB_PID=$! mysql_note "Waiting for server startup" @@ -133,7 +135,9 @@ docker_temp_server_start() { fi local i for i in {30..0}; do - if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then + if docker_process_sql "${extraArgs[@]}" --database=mysql \ + --skip-ssl --skip-ssl-verify-server-cert \ + <<<'SELECT 1' &> /dev/null; then break fi sleep 1 diff --git a/11.5/docker-entrypoint.sh b/11.5/docker-entrypoint.sh index d8d705a2..fa35d577 100755 --- a/11.5/docker-entrypoint.sh +++ b/11.5/docker-entrypoint.sh @@ -121,7 +121,9 @@ mysql_get_config() { docker_temp_server_start() { "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ --expire-logs-days=0 \ - --loose-innodb_buffer_pool_load_at_startup=0 & + --loose-innodb_buffer_pool_load_at_startup=0 \ + --skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \ + & declare -g MARIADB_PID MARIADB_PID=$! mysql_note "Waiting for server startup" @@ -133,7 +135,9 @@ docker_temp_server_start() { fi local i for i in {30..0}; do - if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then + if docker_process_sql "${extraArgs[@]}" --database=mysql \ + --skip-ssl --skip-ssl-verify-server-cert \ + <<<'SELECT 1' &> /dev/null; then break fi sleep 1 diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index db0464bc..e6bba572 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -121,7 +121,9 @@ mysql_get_config() { docker_temp_server_start() { "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ --expire-logs-days=0 \ - --loose-innodb_buffer_pool_load_at_startup=0 & + --loose-innodb_buffer_pool_load_at_startup=0 \ + --skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \ + & declare -g MARIADB_PID MARIADB_PID=$! mysql_note "Waiting for server startup" @@ -133,7 +135,9 @@ docker_temp_server_start() { fi local i for i in {30..0}; do - if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then + if docker_process_sql "${extraArgs[@]}" --database=mysql \ + --skip-ssl --skip-ssl-verify-server-cert \ + <<<'SELECT 1' &> /dev/null; then break fi sleep 1 diff --git a/update.sh b/update.sh index fec31e51..cdda3df6 100755 --- a/update.sh +++ b/update.sh @@ -89,12 +89,14 @@ update_version() -e 's/REPLICATION REPLICA/REPLICATION SLAVE/' \ -e 's/START REPLICA/START SLAVE/' \ -e '/memory\.pressure/,+7d' \ + -e '/--skip-ssl/d' \ "$version/docker-entrypoint.sh" sed -i -e 's/ REPLICA\$/ SLAVE$/' "$dir"/healthcheck.sh sed -i -e 's/\/run/\/var\/run\//g' "$dir/Dockerfile" ;; # almost nothing to see/do here 10.5) sed -i -e '/--old-mode/d' \ + -e '/--skip-ssl/d' \ -e '/memory\.pressure/,+7d' "$dir/docker-entrypoint.sh" sed -i '/backwards compat/d' "$dir/Dockerfile" ;; @@ -127,6 +129,9 @@ update_version() else sed -i -e '/memory\.pressure/,+7d' "$dir/docker-entrypoint.sh" fi + if [[ $vmin = 10.* || $vmin =~ 11.[12] ]]; then + sed -i -e '/--skip-ssl/d' "$dir/docker-entrypoint.sh" + fi if [[ $vmin =~ 11.[012345] ]]; then sed -i -e 's/mysql_upgrade_info/mariadb_upgrade_info/' \ "$dir/docker-entrypoint.sh" "$dir/healthcheck.sh"