Bringing back default restart routine for nginx

This commit is contained in:
myvesta 2018-10-12 20:45:34 +02:00 committed by GitHub
commit 466cf25da8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,11 +49,13 @@ if [ -z "$PROXY_SYSTEM" ] || [ "$PROXY_SYSTEM" = 'remote' ]; then
exit exit
fi fi
# background restart if [ -f "/usr/local/vesta/web/inc/nginx_proxy" ]; then
if [ "$1" = 'background' ]; then
# if vesta is behind default nginx, restart in background with 15 sec delay
# background restart
if [ "$1" = 'background' ]; then
# Restart system # Restart system
sleep 15 sleep 15
# 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
@ -66,21 +68,31 @@ if [ "$1" = 'background' ]; then
fi fi
exit; exit;
fi
# try to reload to get changes faster
service $PROXY_SYSTEM reload
# send to background process
nohup $BIN/v-restart-proxy 'background' &>/dev/null &
else
# Default behaviour
# Restart system
service $PROXY_SYSTEM restart >/dev/null 2>&1
if [ $? -ne 0 ]; then
send_email_report
check_result $E_RESTART "$PROXY_SYSTEM restart failed"
fi
# Update restart queue
if [ -e "$VESTA/data/queue/restart.pipe" ]; then
sed -i "/$SCRIPT/d" $VESTA/data/queue/restart.pipe
fi
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
nohup $BIN/v-restart-proxy 'background' &>/dev/null &
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # Vesta #
#----------------------------------------------------------# #----------------------------------------------------------#