Skip to content

Commit

Permalink
OLMIS-6727:Nginx error when reload the config file occasionally
Browse files Browse the repository at this point in the history
Protect consul-template process from subprocess error. Make Nginx will load the new file instead of the wrong Nginx file when restarting Nginx container.
  • Loading branch information
ylcai committed Jan 13, 2020
1 parent 6e36654 commit b58d6bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down

0 comments on commit b58d6bb

Please sign in to comment.