Extend sleep times and add additional check
This commit is contained in:
parent
ed8afe3dd1
commit
d86a02dac3
@ -3,11 +3,17 @@
|
||||
echo "Start new nginx master..."
|
||||
/bin/systemctl kill --signal=SIGUSR2 nginx.service
|
||||
sleep 5
|
||||
[ ! -f /run/nginx.pid.oldbin ] && sleep 5
|
||||
[ ! -f /run/nginx.pid.oldbin ] && sleep 10
|
||||
if [ ! -f /run/nginx.pid.oldbin ]; then
|
||||
echo "Failed to start new nginx master."
|
||||
exit 1
|
||||
fi
|
||||
echo "Stop old nginx master gracefully..."
|
||||
oldpid=`cat /run/nginx.pid.oldbin 2>/dev/null`
|
||||
oldpid=`/usr/bin/cat /run/nginx.pid.oldbin 2>/dev/null`
|
||||
/bin/kill -s QUIT $oldpid 2>/dev/null
|
||||
sleep 5
|
||||
[ -f /run/nginx.pid.oldbin ] && sleep 10
|
||||
if [ -f /run/nginx.pid.oldbin ]; then
|
||||
echo "Failed to stop old nginx master."
|
||||
exit 1
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user