mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 05:44:08 -07:00
Bringing back default restart routine for nginx
This commit is contained in:
parent
927c288b27
commit
466cf25da8
1 changed files with 41 additions and 29 deletions
|
@ -49,38 +49,50 @@ 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
|
|
||||||
# Restart system
|
# if vesta is behind default nginx, restart in background with 15 sec delay
|
||||||
sleep 15
|
# background restart
|
||||||
# rm /tmp/restart-nginx
|
if [ "$1" = 'background' ]; then
|
||||||
service $PROXY_SYSTEM restart >/dev/null 2>&1
|
# Restart system
|
||||||
if [ $? -ne 0 ]; then
|
sleep 15
|
||||||
send_email_report
|
service $PROXY_SYSTEM restart >/dev/null 2>&1
|
||||||
check_result $E_RESTART "$PROXY_SYSTEM restart failed"
|
if [ $? -ne 0 ]; then
|
||||||
fi
|
send_email_report
|
||||||
|
check_result $E_RESTART "$PROXY_SYSTEM restart failed"
|
||||||
# Update restart queue
|
fi
|
||||||
if [ -e "$VESTA/data/queue/restart.pipe" ]; then
|
|
||||||
sed -i "/$SCRIPT/d" $VESTA/data/queue/restart.pipe
|
# Update restart queue
|
||||||
fi
|
if [ -e "$VESTA/data/queue/restart.pipe" ]; then
|
||||||
|
sed -i "/$SCRIPT/d" $VESTA/data/queue/restart.pipe
|
||||||
|
fi
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
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
|
|
||||||
nohup $BIN/v-restart-proxy 'background' &>/dev/null &
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Vesta #
|
# Vesta #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue