Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 1) Install new binary.
- # 2) Send a USR2 signal to the current pid file.
- # This causes nginx master process that was running to rename its pid and start the new binary.
- # Both will run simultaneously.
- #
- OLDPID=`cat /path/to/nginx/logs/pid.txt`
- echo "OLDPID: $OLDPID"
- sudo kill -USR2 $OLDPID
- # 3) Check the new pid is running.
- ps auxww | fgrep nginx | fgrep 'master process'
- # 4) Send a WINCH to the old process.
- # This disables the old workers.
- sudo kill -WINCH $OLDPID
- # Again, check web works.
- # 5) Kill the old workers.
- sudo kill -QUIT $OLDPID
- # 6) Terminate the old master process, if still running (shouldn't be).
- sudo kill -TERM $OLDPID
Advertisement
Add Comment
Please, Sign In to add comment