v-restart-proxy better restart handling

This commit is contained in:
myvesta 2018-04-24 15:32:57 +02:00 committed by GitHub
commit 04e3413590
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,7 +52,8 @@ fi
# background restart # background restart
if [ "$1" = 'background' ]; then if [ "$1" = 'background' ]; then
# Restart system # Restart system
sleep 20 sleep 300
rm /tmp/restart-nginx
service $PROXY_SYSTEM restart >/dev/null 2>&1 service $PROXY_SYSTEM restart >/dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
send_email_report send_email_report
@ -67,6 +68,16 @@ if [ "$1" = 'background' ]; then
exit; exit;
fi 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 touch /tmp/restart-nginx
nohup $BIN/v-restart-proxy 'background' &>/dev/null & nohup $BIN/v-restart-proxy 'background' &>/dev/null &