Guest User

Untitled

a guest
Feb 24th, 2010
837
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. # 1) Install new binary.
  2.  
  3. # 2) Send a USR2 signal to the current pid file.
  4. # This causes nginx master process that was running to rename its pid and start the new binary.
  5. # Both will run simultaneously.
  6. #
  7.  
  8. OLDPID=`cat /path/to/nginx/logs/pid.txt`
  9. echo "OLDPID: $OLDPID"
  10. sudo kill -USR2 $OLDPID
  11.  
  12. # 3) Check the new pid is running.
  13.  
  14. ps auxww | fgrep nginx | fgrep 'master process'
  15.  
  16. # 4) Send a WINCH to the old process.
  17. # This disables the old workers.
  18. sudo kill -WINCH $OLDPID
  19.  
  20. # Again, check web works.
  21.  
  22. # 5) Kill the old workers.
  23. sudo kill -QUIT $OLDPID
  24.  
  25. # 6) Terminate the old master process, if still running (shouldn't be).
  26. sudo kill -TERM $OLDPID
  27.  
Advertisement
Add Comment
Please, Sign In to add comment