You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

nginx-upgrade 560B

12345678910111213141516171819
  1. #!/bin/sh
  2. [ ! -f /run/nginx.pid ] && exit 1
  3. echo "Start new nginx master..."
  4. /bin/systemctl kill --signal=SIGUSR2 nginx.service
  5. sleep 5
  6. [ ! -f /run/nginx.pid.oldbin ] && sleep 10
  7. if [ ! -f /run/nginx.pid.oldbin ]; then
  8. echo "Failed to start new nginx master."
  9. exit 1
  10. fi
  11. echo "Stop old nginx master gracefully..."
  12. oldpid=`/usr/bin/cat /run/nginx.pid.oldbin 2>/dev/null`
  13. /bin/kill -s QUIT $oldpid 2>/dev/null
  14. sleep 5
  15. [ -f /run/nginx.pid.oldbin ] && sleep 10
  16. if [ -f /run/nginx.pid.oldbin ]; then
  17. echo "Failed to stop old nginx master."
  18. exit 1
  19. fi