From b58d6bb68086561242684910e6b0af93c0dd0251 Mon Sep 17 00:00:00 2001 From: ylcai Date: Mon, 13 Jan 2020 20:50:08 +0800 Subject: [PATCH] OLMIS-6727:Nginx error when reload the config file occasionally Protect consul-template process from subprocess error. Make Nginx will load the new file instead of the wrong Nginx file when restarting Nginx container. --- run.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/run.sh b/run.sh index 49b62ff..b1e504f 100755 --- a/run.sh +++ b/run.sh @@ -23,7 +23,9 @@ export SEND_TIMEOUT="${SEND_TIMEOUT:-${NGINX_TIMEOUT:-60s}}" CONSUL_PATH="${CONSUL_HOST}:${CONSUL_PORT}" INPUT_FILE="/etc/consul-template/openlmis.conf" OUTPUT_FILE="/etc/nginx/conf.d/default.conf" -CALLBACK="nginx -s reload" +CALLBACK="nginx -s reload || true" + +rm -f $OUTPUT_FILE consul-template \ -consul "$CONSUL_PATH" \