Skip to content

Commit 04e3413

Browse files
authored
v-restart-proxy better restart handling
1 parent 1c51af3 commit 04e3413

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

bin/v-restart-proxy

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ fi
5252
# background restart
5353
if [ "$1" = 'background' ]; then
5454
# Restart system
55-
sleep 20
55+
sleep 300
56+
rm /tmp/restart-nginx
5657
service $PROXY_SYSTEM restart >/dev/null 2>&1
5758
if [ $? -ne 0 ]; then
5859
send_email_report
@@ -67,6 +68,16 @@ if [ "$1" = 'background' ]; then
6768
exit;
6869
fi
6970

71+
if [ -f "/tmp/restart-nginx" ]; then
72+
exit;
73+
fi
74+
75+
service $PROXY_SYSTEM reload
76+
if [ $? -ne 0 ]; then
77+
send_email_report
78+
check_result $E_RESTART "$PROXY_SYSTEM reload failed"
79+
fi
80+
7081
touch /tmp/restart-nginx
7182
nohup $BIN/v-restart-proxy 'background' &>/dev/null &
7283

0 commit comments

Comments
 (0)