From 7fb5abe44f2a24b312214879032b7d8331413e63 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Thu, 3 Oct 2019 18:16:08 +0300 Subject: [PATCH] Fixed docker entrypoint command execution --- agent/alpine/docker-entrypoint.sh | 9 ++++++--- java-gateway/alpine/docker-entrypoint.sh | 8 ++++---- proxy-mysql/alpine/docker-entrypoint.sh | 9 ++++++--- proxy-sqlite3/alpine/docker-entrypoint.sh | 9 ++++++--- server-mysql/alpine/docker-entrypoint.sh | 9 ++++++--- server-pgsql/alpine/docker-entrypoint.sh | 9 ++++++--- web-apache-mysql/alpine/docker-entrypoint.sh | 7 +++---- web-apache-pgsql/alpine/docker-entrypoint.sh | 7 +++---- 8 files changed, 40 insertions(+), 27 deletions(-) diff --git a/agent/alpine/docker-entrypoint.sh b/agent/alpine/docker-entrypoint.sh index 05946c21d..cb96852d9 100755 --- a/agent/alpine/docker-entrypoint.sh +++ b/agent/alpine/docker-entrypoint.sh @@ -181,11 +181,14 @@ prepare_agent() { ################################################# -prepare_agent +if [ "${1#-}" != "$1" ]; then + set -- /usr/sbin/zabbix_agentd "$@" +fi -echo "########################################################" +if [ "$1" == '/usr/sbin/zabbix_agentd' ]; then + prepare_agent +fi -echo "** Executing '$@'" exec "$@" ################################################# diff --git a/java-gateway/alpine/docker-entrypoint.sh b/java-gateway/alpine/docker-entrypoint.sh index 19eb9cfe2..2478543d8 100755 --- a/java-gateway/alpine/docker-entrypoint.sh +++ b/java-gateway/alpine/docker-entrypoint.sh @@ -117,11 +117,11 @@ prepare_java_gateway() { ################################################# -prepare_java_gateway +if [ "$1" == '/usr/sbin/zabbix_java_gateway' ]; then + prepare_java_gateway +fi -echo "########################################################" - -echo "** Executing '$@'" exec "$@" + ################################################# diff --git a/proxy-mysql/alpine/docker-entrypoint.sh b/proxy-mysql/alpine/docker-entrypoint.sh index c2492bbfc..a529e8172 100755 --- a/proxy-mysql/alpine/docker-entrypoint.sh +++ b/proxy-mysql/alpine/docker-entrypoint.sh @@ -391,11 +391,14 @@ prepare_proxy() { ################################################# -prepare_proxy +if [ "${1#-}" != "$1" ]; then + set -- /usr/sbin/zabbix_proxy "$@" + fi -echo "########################################################" +if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then + prepare_proxy +fi -echo "** Executing '$@'" exec "$@" ################################################# diff --git a/proxy-sqlite3/alpine/docker-entrypoint.sh b/proxy-sqlite3/alpine/docker-entrypoint.sh index 354314550..adec5d7a6 100755 --- a/proxy-sqlite3/alpine/docker-entrypoint.sh +++ b/proxy-sqlite3/alpine/docker-entrypoint.sh @@ -237,11 +237,14 @@ prepare_proxy() { ################################################# -prepare_proxy +if [ "${1#-}" != "$1" ]; then + set -- /usr/sbin/zabbix_proxy "$@" +fi -echo "########################################################" +if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then + prepare_proxy +fi -echo "** Executing '$@'" exec "$@" ################################################# diff --git a/server-mysql/alpine/docker-entrypoint.sh b/server-mysql/alpine/docker-entrypoint.sh index 3b3fde375..9560099b4 100755 --- a/server-mysql/alpine/docker-entrypoint.sh +++ b/server-mysql/alpine/docker-entrypoint.sh @@ -433,11 +433,14 @@ prepare_server() { ################################################# -prepare_server +if [ "${1#-}" != "$1" ]; then + set -- /usr/sbin/zabbix_server "$@" + fi -echo "########################################################" +if [ "$1" == '/usr/sbin/zabbix_server' ]; then + prepare_server +fi -echo "** Executing '$@'" exec "$@" ################################################# diff --git a/server-pgsql/alpine/docker-entrypoint.sh b/server-pgsql/alpine/docker-entrypoint.sh index 8ff5cc1b4..77943ce8d 100755 --- a/server-pgsql/alpine/docker-entrypoint.sh +++ b/server-pgsql/alpine/docker-entrypoint.sh @@ -400,11 +400,14 @@ prepare_server() { ################################################# -prepare_server +if [ "${1#-}" != "$1" ]; then + set -- /usr/sbin/zabbix_server "$@" +fi -echo "########################################################" +if [ "$1" == '/usr/sbin/zabbix_server' ]; then + prepare_server +fi -echo "** Executing '$@'" exec "$@" ################################################# diff --git a/web-apache-mysql/alpine/docker-entrypoint.sh b/web-apache-mysql/alpine/docker-entrypoint.sh index e0ce6b7af..a2c031392 100755 --- a/web-apache-mysql/alpine/docker-entrypoint.sh +++ b/web-apache-mysql/alpine/docker-entrypoint.sh @@ -267,11 +267,10 @@ prepare_web() { ################################################# -prepare_web +if [ "$1" == '/usr/sbin/httpd' ]; then + prepare_web +fi -echo "########################################################" - -echo "** Executing '$@'" exec "$@" ################################################# diff --git a/web-apache-pgsql/alpine/docker-entrypoint.sh b/web-apache-pgsql/alpine/docker-entrypoint.sh index 4c302a09b..4afe81aa5 100755 --- a/web-apache-pgsql/alpine/docker-entrypoint.sh +++ b/web-apache-pgsql/alpine/docker-entrypoint.sh @@ -285,11 +285,10 @@ prepare_web() { ################################################# -prepare_web +if [ "$1" == '/usr/sbin/httpd' ]; then + prepare_web +fi -echo "########################################################" - -echo "** Executing '$@'" exec "$@" #################################################