mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 13:54:28 -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
|
||||
fi
|
||||
|
||||
# background restart
|
||||
if [ "$1" = 'background' ]; then
|
||||
# Restart system
|
||||
sleep 15
|
||||
# rm /tmp/restart-nginx
|
||||
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
|
||||
if [ -f "/usr/local/vesta/web/inc/nginx_proxy" ]; then
|
||||
|
||||
# if vesta is behind default nginx, restart in background with 15 sec delay
|
||||
# background restart
|
||||
if [ "$1" = 'background' ]; then
|
||||
# Restart system
|
||||
sleep 15
|
||||
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
|
||||
|
||||
# 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
|
||||
|
||||
# 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 #
|
||||
#----------------------------------------------------------#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue