Created
July 18, 2013 15:45
-
-
Save everaldo/6030414 to your computer and use it in GitHub Desktop.
upgrading Nginx Gracefully
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replace the old Nginx binary (by default, /usr/local/nginx/sbin/nginx) with the new one. | |
Find the pid of the Nginx master process, for example, with ps x | grep nginx | grep master or by looking at the value found in the pid file. | |
Send a USR2 (12) signal to the master process kill USR2 ***, replacing *** with the pid found in step 2. This will initiate the upgrade by renaming the old .pid file and running the new binary. | |
Send a WINCH (28) signal to the old master process kill WINCH ***, replacing *** with the pid found in step 2. This will engage a graceful shutdown of the old worker processes. | |
Make sure that all the old worker processes are terminated, and then send a QUIT signal to the old master process kill QUIT ***, replacing *** with the pid found in step 2. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment