Blame SOURCES/action-upgrade.sh

810fe6
#!/bin/sh
810fe6
[ ! -f $localstatedir/run/nginx/nginx.pid ] && exit 1
810fe6
echo "Start new nginx master..."
810fe6
/bin/systemctl kill --signal=SIGUSR2 $nginxservice
810fe6
sleep 5
810fe6
[ ! -f $localstatedir/run/nginx/nginx.pid.oldbin ] && sleep 5
810fe6
if [ ! -f $localstatedir/run/nginx/nginx.pid.oldbin ]; then
810fe6
	echo "Failed to start new nginx master."
810fe6
	exit 1
810fe6
fi
810fe6
echo "Stop old nginx master gracefully..."
810fe6
oldpid=`cat $localstatedir/run/nginx/nginx.pid.oldbin 2>/dev/null`
810fe6
/bin/kill -s QUIT $oldpid 2>/dev/null