From d4765c3704dc8e14076a8bc990c9985215966dbd Mon Sep 17 00:00:00 2001 From: Honza Horak Date: Mon, 23 Oct 2017 07:59:30 +0200 Subject: [PATCH] Add debugging info into passwd-change script --- .../usr/share/container-scripts/mysql/helpers.sh | 8 ++++++++ .../container-scripts/mysql/init/50-passwd-change.sh | 11 +++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/root-common/usr/share/container-scripts/mysql/helpers.sh b/root-common/usr/share/container-scripts/mysql/helpers.sh index 4e832fcd..2dee842b 100644 --- a/root-common/usr/share/container-scripts/mysql/helpers.sh +++ b/root-common/usr/share/container-scripts/mysql/helpers.sh @@ -7,6 +7,14 @@ function log_and_run { "$@" } +function log_debug { + CONTAINER_DEBUG=${CONTAINER_DEBUG:-} + if [[ "${CONTAINER_DEBUG,,}" != "true" ]]; then + return + fi + log_info $@ +} + function log_volume_info { CONTAINER_DEBUG=${CONTAINER_DEBUG:-} if [[ "${CONTAINER_DEBUG,,}" != "true" ]]; then diff --git a/root-common/usr/share/container-scripts/mysql/init/50-passwd-change.sh b/root-common/usr/share/container-scripts/mysql/init/50-passwd-change.sh index 2514f2dc..be64b4f4 100644 --- a/root-common/usr/share/container-scripts/mysql/init/50-passwd-change.sh +++ b/root-common/usr/share/container-scripts/mysql/init/50-passwd-change.sh @@ -4,9 +4,11 @@ password_change() { # 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 + log_debug "About to change password for user '${MYSQL_USER}'." mysql $mysql_flags < "5.6" ] ; then mysql $mysql_flags < "5.6" ] ; then @@ -38,11 +41,15 @@ mysql $mysql_flags <