mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
Restart nginx in background
This commit is contained in:
parent
a57c8b775b
commit
b04dce9ce3
1 changed files with 18 additions and 10 deletions
|
@ -49,18 +49,26 @@ if [ -z "$PROXY_SYSTEM" ] || [ "$PROXY_SYSTEM" = 'remote' ]; then
|
|||
exit
|
||||
fi
|
||||
|
||||
# Restart system
|
||||
service $PROXY_SYSTEM reload >/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
|
||||
# background restart
|
||||
if [ "$1" = 'background' ]; then
|
||||
# Restart system
|
||||
sleep 2
|
||||
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
|
||||
|
||||
touch /tmp/restart-nginx
|
||||
nohup $BIN/v-restart-proxy 'background' &>/dev/null &
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue