Welcome! Log In Create A New Profile

Advanced

Recommended method to update binary from script

August 03, 2010 11:29PM
Dear all,

I have trouble updating the nginx binary without downtime, from a script.

The company I work for runs nginx (0.7.64) as a front-end and apache
(1.3.37 with mod_perl) as a back-end web server on CentOS 4.8 on
VMWare ESX virtual machines.

I need to update the nginx binary to version 0.7.67 on one
production server, without downtime, and after searching found one
method is to send the following sequence of commands to the nginx
master process to get a "graceful" switchover after replacing the binary:

kill -USR2 <oldmaster-PID> # to start a 2nd (new) master & workers
kill -WINCH <oldmaster-PID> # to kill old workers
kill -QUIT <oldmaster-PID> # to shut down old master, PPID becomes 1

This sequence works fine from the command line. It also works fine
from a script on a fast standalone test system running CentOS 5.5. But
on a (less powerful) VMWare clone of the production server, with
CentOS 4.8, the last signal when executed within a shell script kills
the entire nginx, including the new master and workers.

I found that if I insert a pause (2 seconds) before the QUIT signal
all is well, but I am not sure of the recommended method. Now I
replaced the pause with a search for the new master process (PID new,
PPID equals the old master process), and that also works for me for
now.

I expect that the handling of signals takes some time, but would
appreciate any pointers on what to check for in order to know that it
is safe to execute further signal.

Best regards,
Gernot Hassenpflug
Asahi-Net, Tokyo, Japan
Subject Author Posted

Recommended method to update binary from script

shugyo August 03, 2010 11:29PM

Re: Recommended method to update binary from script

Igor Sysoev August 03, 2010 11:44PM

Re: Recommended method to update binary from script

shugyo August 04, 2010 01:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 57
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready