diff --git a/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh index 04d35e607..06f5b2901 100755 --- a/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh @@ -466,15 +466,20 @@ update_zbx_config() { fi } -prepare_proxy() { - echo "Preparing Zabbix proxy" +prepare_db() { + echo "** Preparing database" check_variables_mysql check_db_connect_mysql create_db_user_mysql create_db_database_mysql create_db_schema_mysql +} +prepare_proxy() { + echo "** Preparing Zabbix proxy" + + prepare_db update_zbx_config } @@ -482,12 +487,16 @@ prepare_proxy() { if [ "${1#-}" != "$1" ]; then set -- /usr/sbin/zabbix_proxy "$@" - fi +fi if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then prepare_proxy fi -exec "$@" +if [ "$1" == "init_db_only" ]; then + prepare_db +else + exec "$@" +fi ################################################# diff --git a/Dockerfiles/proxy-mysql/centos/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/centos/docker-entrypoint.sh index 530fb7ebf..a46ce3aac 100755 --- a/Dockerfiles/proxy-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/centos/docker-entrypoint.sh @@ -463,15 +463,20 @@ update_zbx_config() { fi } -prepare_proxy() { - echo "Preparing Zabbix proxy" +prepare_db() { + echo "** Preparing database" check_variables_mysql check_db_connect_mysql create_db_user_mysql create_db_database_mysql create_db_schema_mysql +} +prepare_proxy() { + echo "** Preparing Zabbix proxy" + + prepare_db update_zbx_config } @@ -479,12 +484,16 @@ prepare_proxy() { if [ "${1#-}" != "$1" ]; then set -- /usr/sbin/zabbix_proxy "$@" - fi +fi if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then prepare_proxy fi -exec "$@" +if [ "$1" == "init_db_only" ]; then + prepare_db +else + exec "$@" +fi ################################################# diff --git a/Dockerfiles/proxy-mysql/ol/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/ol/docker-entrypoint.sh index 530fb7ebf..a46ce3aac 100755 --- a/Dockerfiles/proxy-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/ol/docker-entrypoint.sh @@ -463,15 +463,20 @@ update_zbx_config() { fi } -prepare_proxy() { - echo "Preparing Zabbix proxy" +prepare_db() { + echo "** Preparing database" check_variables_mysql check_db_connect_mysql create_db_user_mysql create_db_database_mysql create_db_schema_mysql +} +prepare_proxy() { + echo "** Preparing Zabbix proxy" + + prepare_db update_zbx_config } @@ -479,12 +484,16 @@ prepare_proxy() { if [ "${1#-}" != "$1" ]; then set -- /usr/sbin/zabbix_proxy "$@" - fi +fi if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then prepare_proxy fi -exec "$@" +if [ "$1" == "init_db_only" ]; then + prepare_db +else + exec "$@" +fi ################################################# diff --git a/Dockerfiles/proxy-mysql/rhel/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/rhel/docker-entrypoint.sh index 530fb7ebf..a46ce3aac 100755 --- a/Dockerfiles/proxy-mysql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/rhel/docker-entrypoint.sh @@ -463,15 +463,20 @@ update_zbx_config() { fi } -prepare_proxy() { - echo "Preparing Zabbix proxy" +prepare_db() { + echo "** Preparing database" check_variables_mysql check_db_connect_mysql create_db_user_mysql create_db_database_mysql create_db_schema_mysql +} +prepare_proxy() { + echo "** Preparing Zabbix proxy" + + prepare_db update_zbx_config } @@ -479,12 +484,16 @@ prepare_proxy() { if [ "${1#-}" != "$1" ]; then set -- /usr/sbin/zabbix_proxy "$@" - fi +fi if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then prepare_proxy fi -exec "$@" +if [ "$1" == "init_db_only" ]; then + prepare_db +else + exec "$@" +fi ################################################# diff --git a/Dockerfiles/proxy-mysql/ubuntu/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/ubuntu/docker-entrypoint.sh index 9bd8c3bcd..26f85c699 100755 --- a/Dockerfiles/proxy-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/ubuntu/docker-entrypoint.sh @@ -463,15 +463,20 @@ update_zbx_config() { fi } -prepare_proxy() { - echo "Preparing Zabbix proxy" +prepare_db() { + echo "** Preparing database" check_variables_mysql check_db_connect_mysql create_db_user_mysql create_db_database_mysql create_db_schema_mysql +} +prepare_proxy() { + echo "** Preparing Zabbix proxy" + + prepare_db update_zbx_config } @@ -479,12 +484,16 @@ prepare_proxy() { if [ "${1#-}" != "$1" ]; then set -- /usr/sbin/zabbix_proxy "$@" - fi +fi if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then prepare_proxy fi -exec "$@" +if [ "$1" == "init_db_only" ]; then + prepare_db +else + exec "$@" +fi ################################################# diff --git a/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh index 39cdc3b8a..686011f96 100755 --- a/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh @@ -479,15 +479,20 @@ update_zbx_config() { fi } -prepare_server() { - echo "** Preparing Zabbix server" +prepare_db() { + echo "** Preparing database" check_variables_mysql check_db_connect_mysql create_db_user_mysql create_db_database_mysql create_db_schema_mysql +} +prepare_server() { + echo "** Preparing Zabbix server" + + prepare_db update_zbx_config } @@ -495,12 +500,16 @@ prepare_server() { if [ "${1#-}" != "$1" ]; then set -- /usr/sbin/zabbix_server "$@" - fi +fi if [ "$1" == '/usr/sbin/zabbix_server' ]; then prepare_server fi -exec "$@" +if [ "$1" == "init_db_only" ]; then + prepare_db +else + exec "$@" +fi ################################################# diff --git a/Dockerfiles/server-mysql/centos/docker-entrypoint.sh b/Dockerfiles/server-mysql/centos/docker-entrypoint.sh index 0e00ddbf6..f322ae308 100755 --- a/Dockerfiles/server-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/centos/docker-entrypoint.sh @@ -476,15 +476,20 @@ update_zbx_config() { fi } -prepare_server() { - echo "** Preparing Zabbix server" +prepare_db() { + echo "** Preparing database" check_variables_mysql check_db_connect_mysql create_db_user_mysql create_db_database_mysql create_db_schema_mysql +} +prepare_server() { + echo "** Preparing Zabbix server" + + prepare_db update_zbx_config } @@ -492,12 +497,16 @@ prepare_server() { if [ "${1#-}" != "$1" ]; then set -- /usr/sbin/zabbix_server "$@" - fi +fi if [ "$1" == '/usr/sbin/zabbix_server' ]; then prepare_server fi -exec "$@" +if [ "$1" == "init_db_only" ]; then + prepare_db +else + exec "$@" +fi ################################################# diff --git a/Dockerfiles/server-mysql/ol/docker-entrypoint.sh b/Dockerfiles/server-mysql/ol/docker-entrypoint.sh index 0e00ddbf6..f322ae308 100755 --- a/Dockerfiles/server-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/ol/docker-entrypoint.sh @@ -476,15 +476,20 @@ update_zbx_config() { fi } -prepare_server() { - echo "** Preparing Zabbix server" +prepare_db() { + echo "** Preparing database" check_variables_mysql check_db_connect_mysql create_db_user_mysql create_db_database_mysql create_db_schema_mysql +} +prepare_server() { + echo "** Preparing Zabbix server" + + prepare_db update_zbx_config } @@ -492,12 +497,16 @@ prepare_server() { if [ "${1#-}" != "$1" ]; then set -- /usr/sbin/zabbix_server "$@" - fi +fi if [ "$1" == '/usr/sbin/zabbix_server' ]; then prepare_server fi -exec "$@" +if [ "$1" == "init_db_only" ]; then + prepare_db +else + exec "$@" +fi ################################################# diff --git a/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh b/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh index 0e00ddbf6..f322ae308 100755 --- a/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh @@ -476,15 +476,20 @@ update_zbx_config() { fi } -prepare_server() { - echo "** Preparing Zabbix server" +prepare_db() { + echo "** Preparing database" check_variables_mysql check_db_connect_mysql create_db_user_mysql create_db_database_mysql create_db_schema_mysql +} +prepare_server() { + echo "** Preparing Zabbix server" + + prepare_db update_zbx_config } @@ -492,12 +497,16 @@ prepare_server() { if [ "${1#-}" != "$1" ]; then set -- /usr/sbin/zabbix_server "$@" - fi +fi if [ "$1" == '/usr/sbin/zabbix_server' ]; then prepare_server fi -exec "$@" +if [ "$1" == "init_db_only" ]; then + prepare_db +else + exec "$@" +fi ################################################# diff --git a/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh b/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh index 881a6b11a..e9a8960c5 100755 --- a/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh @@ -476,15 +476,20 @@ update_zbx_config() { fi } -prepare_server() { - echo "** Preparing Zabbix server" +prepare_db() { + echo "** Preparing database" check_variables_mysql check_db_connect_mysql create_db_user_mysql create_db_database_mysql create_db_schema_mysql +} +prepare_server() { + echo "** Preparing Zabbix server" + + prepare_db update_zbx_config } @@ -492,12 +497,16 @@ prepare_server() { if [ "${1#-}" != "$1" ]; then set -- /usr/sbin/zabbix_server "$@" - fi +fi if [ "$1" == '/usr/sbin/zabbix_server' ]; then prepare_server fi -exec "$@" +if [ "$1" == "init_db_only" ]; then + prepare_db +else + exec "$@" +fi ################################################# diff --git a/Dockerfiles/server-pgsql/alpine/docker-entrypoint.sh b/Dockerfiles/server-pgsql/alpine/docker-entrypoint.sh index 2f62adaa1..09447e13c 100755 --- a/Dockerfiles/server-pgsql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/server-pgsql/alpine/docker-entrypoint.sh @@ -514,14 +514,19 @@ update_zbx_config() { fi } -prepare_server() { - echo "** Preparing Zabbix server" +prepare_db() { + echo "** Preparing database" check_variables_postgresql check_db_connect_postgresql create_db_database_postgresql create_db_schema_postgresql +} +prepare_server() { + echo "** Preparing Zabbix server" + + prepare_db update_zbx_config } @@ -535,6 +540,10 @@ if [ "$1" == '/usr/sbin/zabbix_server' ]; then prepare_server fi -exec "$@" +if [ "$1" == "init_db_only" ]; then + prepare_db +else + exec "$@" +fi ################################################# diff --git a/Dockerfiles/server-pgsql/centos/docker-entrypoint.sh b/Dockerfiles/server-pgsql/centos/docker-entrypoint.sh index 2f62adaa1..09447e13c 100755 --- a/Dockerfiles/server-pgsql/centos/docker-entrypoint.sh +++ b/Dockerfiles/server-pgsql/centos/docker-entrypoint.sh @@ -514,14 +514,19 @@ update_zbx_config() { fi } -prepare_server() { - echo "** Preparing Zabbix server" +prepare_db() { + echo "** Preparing database" check_variables_postgresql check_db_connect_postgresql create_db_database_postgresql create_db_schema_postgresql +} +prepare_server() { + echo "** Preparing Zabbix server" + + prepare_db update_zbx_config } @@ -535,6 +540,10 @@ if [ "$1" == '/usr/sbin/zabbix_server' ]; then prepare_server fi -exec "$@" +if [ "$1" == "init_db_only" ]; then + prepare_db +else + exec "$@" +fi ################################################# diff --git a/Dockerfiles/server-pgsql/ol/docker-entrypoint.sh b/Dockerfiles/server-pgsql/ol/docker-entrypoint.sh index 2f62adaa1..09447e13c 100755 --- a/Dockerfiles/server-pgsql/ol/docker-entrypoint.sh +++ b/Dockerfiles/server-pgsql/ol/docker-entrypoint.sh @@ -514,14 +514,19 @@ update_zbx_config() { fi } -prepare_server() { - echo "** Preparing Zabbix server" +prepare_db() { + echo "** Preparing database" check_variables_postgresql check_db_connect_postgresql create_db_database_postgresql create_db_schema_postgresql +} +prepare_server() { + echo "** Preparing Zabbix server" + + prepare_db update_zbx_config } @@ -535,6 +540,10 @@ if [ "$1" == '/usr/sbin/zabbix_server' ]; then prepare_server fi -exec "$@" +if [ "$1" == "init_db_only" ]; then + prepare_db +else + exec "$@" +fi ################################################# diff --git a/Dockerfiles/server-pgsql/ubuntu/docker-entrypoint.sh b/Dockerfiles/server-pgsql/ubuntu/docker-entrypoint.sh index bc83dd5bf..6bbe05819 100755 --- a/Dockerfiles/server-pgsql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/server-pgsql/ubuntu/docker-entrypoint.sh @@ -514,14 +514,19 @@ update_zbx_config() { fi } -prepare_server() { - echo "** Preparing Zabbix server" +prepare_db() { + echo "** Preparing database" check_variables_postgresql check_db_connect_postgresql create_db_database_postgresql create_db_schema_postgresql +} +prepare_server() { + echo "** Preparing Zabbix server" + + prepare_db update_zbx_config } @@ -535,6 +540,10 @@ if [ "$1" == '/usr/sbin/zabbix_server' ]; then prepare_server fi -exec "$@" +if [ "$1" == "init_db_only" ]; then + prepare_db +else + exec "$@" +fi #################################################