From 04e3413590192667eb0972c861f7c204f1b9b670 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Tue, 24 Apr 2018 15:32:57 +0200 Subject: [PATCH] v-restart-proxy better restart handling --- bin/v-restart-proxy | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/v-restart-proxy b/bin/v-restart-proxy index f8e6a95e..7b8b4dd2 100755 --- a/bin/v-restart-proxy +++ b/bin/v-restart-proxy @@ -52,7 +52,8 @@ fi # background restart if [ "$1" = 'background' ]; then # Restart system - sleep 20 + sleep 300 + rm /tmp/restart-nginx service $PROXY_SYSTEM restart >/dev/null 2>&1 if [ $? -ne 0 ]; then send_email_report @@ -67,6 +68,16 @@ if [ "$1" = 'background' ]; then exit; fi +if [ -f "/tmp/restart-nginx" ]; then + exit; +fi + +service $PROXY_SYSTEM reload +if [ $? -ne 0 ]; then + send_email_report + check_result $E_RESTART "$PROXY_SYSTEM reload failed" +fi + touch /tmp/restart-nginx nohup $BIN/v-restart-proxy 'background' &>/dev/null &