From 697c3b19154d7111bc3fbc77f66d24cc26310861 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Tue, 5 Nov 2019 15:32:23 +0200 Subject: [PATCH] Do not create Zabbix user if root user is not specified for MySQL --- proxy-mysql/alpine/docker-entrypoint.sh | 2 +- proxy-mysql/centos/docker-entrypoint.sh | 2 +- proxy-mysql/ubuntu/docker-entrypoint.sh | 2 +- server-mysql/alpine/docker-entrypoint.sh | 2 +- server-mysql/centos/docker-entrypoint.sh | 2 +- server-mysql/ubuntu/docker-entrypoint.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/proxy-mysql/alpine/docker-entrypoint.sh b/proxy-mysql/alpine/docker-entrypoint.sh index cbae7d270..1cbeec039 100755 --- a/proxy-mysql/alpine/docker-entrypoint.sh +++ b/proxy-mysql/alpine/docker-entrypoint.sh @@ -159,7 +159,7 @@ check_variables_mysql() { DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi - [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true + [ -n "${MYSQL_USER}" ] && [ "${USE_DB_ROOT_USER}" == "true" ] && CREATE_ZBX_DB_USER=true # If root password is not specified use provided credentials DB_SERVER_ROOT_USER=${DB_SERVER_ROOT_USER:-${MYSQL_USER}} diff --git a/proxy-mysql/centos/docker-entrypoint.sh b/proxy-mysql/centos/docker-entrypoint.sh index 2665cfd0d..df34f9068 100755 --- a/proxy-mysql/centos/docker-entrypoint.sh +++ b/proxy-mysql/centos/docker-entrypoint.sh @@ -267,7 +267,7 @@ check_variables_mysql() { DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi - [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true + [ -n "${MYSQL_USER}" ] && [ "${USE_DB_ROOT_USER}" == "true" ] && CREATE_ZBX_DB_USER=true # If root password is not specified use provided credentials DB_SERVER_ROOT_USER=${DB_SERVER_ROOT_USER:-${MYSQL_USER}} diff --git a/proxy-mysql/ubuntu/docker-entrypoint.sh b/proxy-mysql/ubuntu/docker-entrypoint.sh index 2665cfd0d..df34f9068 100755 --- a/proxy-mysql/ubuntu/docker-entrypoint.sh +++ b/proxy-mysql/ubuntu/docker-entrypoint.sh @@ -267,7 +267,7 @@ check_variables_mysql() { DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi - [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true + [ -n "${MYSQL_USER}" ] && [ "${USE_DB_ROOT_USER}" == "true" ] && CREATE_ZBX_DB_USER=true # If root password is not specified use provided credentials DB_SERVER_ROOT_USER=${DB_SERVER_ROOT_USER:-${MYSQL_USER}} diff --git a/server-mysql/alpine/docker-entrypoint.sh b/server-mysql/alpine/docker-entrypoint.sh index cd12833fd..d9ae00f09 100755 --- a/server-mysql/alpine/docker-entrypoint.sh +++ b/server-mysql/alpine/docker-entrypoint.sh @@ -212,7 +212,7 @@ check_variables_mysql() { DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi - [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true + [ -n "${MYSQL_USER}" ] && [ "${USE_DB_ROOT_USER}" == "true" ] && CREATE_ZBX_DB_USER=true # If root password is not specified use provided credentials : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} diff --git a/server-mysql/centos/docker-entrypoint.sh b/server-mysql/centos/docker-entrypoint.sh index 2665cfd0d..df34f9068 100755 --- a/server-mysql/centos/docker-entrypoint.sh +++ b/server-mysql/centos/docker-entrypoint.sh @@ -267,7 +267,7 @@ check_variables_mysql() { DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi - [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true + [ -n "${MYSQL_USER}" ] && [ "${USE_DB_ROOT_USER}" == "true" ] && CREATE_ZBX_DB_USER=true # If root password is not specified use provided credentials DB_SERVER_ROOT_USER=${DB_SERVER_ROOT_USER:-${MYSQL_USER}} diff --git a/server-mysql/ubuntu/docker-entrypoint.sh b/server-mysql/ubuntu/docker-entrypoint.sh index 2665cfd0d..df34f9068 100755 --- a/server-mysql/ubuntu/docker-entrypoint.sh +++ b/server-mysql/ubuntu/docker-entrypoint.sh @@ -267,7 +267,7 @@ check_variables_mysql() { DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi - [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true + [ -n "${MYSQL_USER}" ] && [ "${USE_DB_ROOT_USER}" == "true" ] && CREATE_ZBX_DB_USER=true # If root password is not specified use provided credentials DB_SERVER_ROOT_USER=${DB_SERVER_ROOT_USER:-${MYSQL_USER}}