From c5550f0dfbc6121a690c6ec693d0f751ed23c597 Mon Sep 17 00:00:00 2001 From: Kenjiro Nakayama Date: Sat, 21 Oct 2017 19:22:43 +0900 Subject: [PATCH 1/2] Unset -e inside passwd-change.sh --- 5.5/root/usr/share/container-scripts/mysql/passwd-change.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/5.5/root/usr/share/container-scripts/mysql/passwd-change.sh b/5.5/root/usr/share/container-scripts/mysql/passwd-change.sh index cd3f0a38..8e2cfe4e 100644 --- a/5.5/root/usr/share/container-scripts/mysql/passwd-change.sh +++ b/5.5/root/usr/share/container-scripts/mysql/passwd-change.sh @@ -1,3 +1,4 @@ +set +e # Set the password for MySQL user and root everytime this container is started. # This allows to change the password by editing the deployment configuration. if [[ -v MYSQL_USER && -v MYSQL_PASSWORD ]]; then @@ -22,4 +23,4 @@ else FLUSH PRIVILEGES; EOSQL fi - +set -e From 061fd4713894226f7ce8231af8f36908f46f208f Mon Sep 17 00:00:00 2001 From: Kenjiro Nakayama Date: Mon, 6 Nov 2017 11:34:03 +0900 Subject: [PATCH 2/2] Introduce DEBUG_IGNORE_SCRIPT_FAILURES option to rescue from failure of the setup script --- 5.5/root/usr/share/container-scripts/mysql/passwd-change.sh | 2 -- root-common/usr/bin/run-mysqld | 3 +++ root-common/usr/bin/run-mysqld-master | 3 +++ root-common/usr/bin/run-mysqld-slave | 3 +++ root-common/usr/share/container-scripts/mysql/helpers.sh | 3 +++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/5.5/root/usr/share/container-scripts/mysql/passwd-change.sh b/5.5/root/usr/share/container-scripts/mysql/passwd-change.sh index 8e2cfe4e..f0fb1a54 100644 --- a/5.5/root/usr/share/container-scripts/mysql/passwd-change.sh +++ b/5.5/root/usr/share/container-scripts/mysql/passwd-change.sh @@ -1,4 +1,3 @@ -set +e # Set the password for MySQL user and root everytime this container is started. # This allows to change the password by editing the deployment configuration. if [[ -v MYSQL_USER && -v MYSQL_PASSWORD ]]; then @@ -23,4 +22,3 @@ else FLUSH PRIVILEGES; EOSQL fi -set -e diff --git a/root-common/usr/bin/run-mysqld b/root-common/usr/bin/run-mysqld index 7ffd49e6..2aa2fa32 100755 --- a/root-common/usr/bin/run-mysqld +++ b/root-common/usr/bin/run-mysqld @@ -3,6 +3,9 @@ export_vars=$(cgroup-limits); export $export_vars source ${CONTAINER_SCRIPTS_PATH}/common.sh set -eu +if [[ -v DEBUG_IGNORE_SCRIPT_FAILURES ]]; then + set +e +fi export_setting_variables diff --git a/root-common/usr/bin/run-mysqld-master b/root-common/usr/bin/run-mysqld-master index ed332eaa..f8b481e9 100755 --- a/root-common/usr/bin/run-mysqld-master +++ b/root-common/usr/bin/run-mysqld-master @@ -6,6 +6,9 @@ export_vars=$(cgroup-limits); export $export_vars source ${CONTAINER_SCRIPTS_PATH}/common.sh set -eu +if [[ -v DEBUG_IGNORE_SCRIPT_FAILURES ]]; then + set +e +fi export_setting_variables diff --git a/root-common/usr/bin/run-mysqld-slave b/root-common/usr/bin/run-mysqld-slave index e1071ff0..d16a86da 100755 --- a/root-common/usr/bin/run-mysqld-slave +++ b/root-common/usr/bin/run-mysqld-slave @@ -6,6 +6,9 @@ export_vars=$(cgroup-limits); export $export_vars source ${CONTAINER_SCRIPTS_PATH}/common.sh set -eu +if [[ -v DEBUG_IGNORE_SCRIPT_FAILURES ]]; then + set +e +fi export_setting_variables diff --git a/root-common/usr/share/container-scripts/mysql/helpers.sh b/root-common/usr/share/container-scripts/mysql/helpers.sh index 4e832fcd..bc5b0f8d 100644 --- a/root-common/usr/share/container-scripts/mysql/helpers.sh +++ b/root-common/usr/share/container-scripts/mysql/helpers.sh @@ -21,4 +21,7 @@ function log_volume_info { shift done set -e + if [[ -v DEBUG_IGNORE_SCRIPT_FAILURES ]]; then + set +e + fi }