From c248edfc528c5cb01e454527dd0f38352b282050 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Wed, 2 Oct 2024 11:24:58 -0700 Subject: [PATCH] Spit out log message when retrying db connection on bootstrap --- core/blocky/blocky.nomad | 2 +- core/grafana.nomad | 2 +- services/service/service_template.nomad | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/blocky/blocky.nomad b/core/blocky/blocky.nomad index aeda4a3..4676181 100644 --- a/core/blocky/blocky.nomad +++ b/core/blocky/blocky.nomad @@ -323,7 +323,7 @@ EOF args = [ "/bin/bash", "-c", - "/usr/bin/timeout 2m /bin/bash -c \"until /usr/bin/mysql --defaults-extra-file=$${NOMAD_SECRETS_DIR}/my.cnf < $${NOMAD_SECRETS_DIR}/bootstrap.sql; do sleep 10; done\" || true", + "/usr/bin/timeout 2m /bin/bash -c \"until /usr/bin/mysql --defaults-extra-file=$${NOMAD_SECRETS_DIR}/my.cnf < $${NOMAD_SECRETS_DIR}/bootstrap.sql; do echo 'Retry in 10s'; sleep 10; done\" || true", ] } diff --git a/core/grafana.nomad b/core/grafana.nomad index 13b9fbf..e82e64f 100644 --- a/core/grafana.nomad +++ b/core/grafana.nomad @@ -89,7 +89,7 @@ EOF "20m", "/bin/bash", "-c", - "until /usr/bin/mysql --defaults-extra-file=$${NOMAD_SECRETS_DIR}/my.cnf < $${NOMAD_SECRETS_DIR}/bootstrap.sql; do sleep 10; done", + "until /usr/bin/mysql --defaults-extra-file=$${NOMAD_SECRETS_DIR}/my.cnf < $${NOMAD_SECRETS_DIR}/bootstrap.sql; do echo 'Retry in 10s'; sleep 10; done", ] } diff --git a/services/service/service_template.nomad b/services/service/service_template.nomad index f25a726..5893faa 100644 --- a/services/service/service_template.nomad +++ b/services/service/service_template.nomad @@ -258,7 +258,7 @@ EOF "20m", "/bin/bash", "-c", - "until /usr/bin/mysql --defaults-extra-file=$${NOMAD_SECRETS_DIR}/my.cnf < $${NOMAD_SECRETS_DIR}/bootstrap.sql; do sleep 10; done", + "until /usr/bin/mysql --defaults-extra-file=$${NOMAD_SECRETS_DIR}/my.cnf < $${NOMAD_SECRETS_DIR}/bootstrap.sql; do echo 'Retry in 10s'; sleep 10; done", ] } @@ -321,7 +321,7 @@ SELECT 'NOOP'; "20m", "/bin/bash", "-c", - "until /bin/bash $${NOMAD_TASK_DIR}/bootstrap.sh; do sleep 10; done", + "until /bin/bash $${NOMAD_TASK_DIR}/bootstrap.sh; do echo 'Retry in 10s'; sleep 10; done", ] }