<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Thanks Maxim!<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Helpful and concise as always. :o)<br></div><div class="gmail_extra"><div><div class="gmail_signature" data-smartmail="gmail_signature"><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font></div></div>
<br><div class="gmail_quote">On Wed, Jun 29, 2016 at 7:38 PM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<span class=""><br>
On Wed, Jun 29, 2016 at 07:04:48PM +0200, B.R. wrote:<br>
<br>
> Kind of basic question about nginx behavior here.<br>
><br>
> On the docs page <a href="http://nginx.org/en/docs/control.html" rel="noreferrer" target="_blank">http://nginx.org/en/docs/control.html</a>, it is said :<br>
><br>
> > HUP -> changing configuration, keeping up with a changed time zone (only<br>
> > for FreeBSD and Linux), starting new worker processes with a new<br>
> > configuration, graceful shutdown of old worker processes<br>
><br>
> This is exact since the HUP signal is used to reload configuration and<br>
> spawn new workers with it.<br>
><br>
> However, a little bit further on the same page, in the on-the-fly upgrade<br>
> section, you got:<br>
><br>
> > Send the HUP signal to the old master process. The old master process will<br>
> > start new worker processes without re-reading the configuration. After<br>
> > that, all new processes can be shut down gracefully, by sending the QUIT<br>
> > signal to the new master process.<br>
><br>
> Is this behavior due to the USR2 signal previously sent, the old master<br>
> knowing it is the old one (and thus knowing it should avoid loading an<br>
> improper configuration suitable for another version)?<br>
<br>
</span>Yes. The old master knows it previously started a new master,<br>
and on the HUP signal it just starts new workers (if the new<br>
master is still running). If/when the old master exits, the old<br>
master is notified about this, and starts to work normally.<br>
<br>
Additional details can be found in<br>
src/os/unix/ngx_process_cycle.c:<br>
<br>
<a href="http://hg.nginx.org/nginx/file/tip/src/os/unix/ngx_process_cycle.c#l220" rel="noreferrer" target="_blank">http://hg.nginx.org/nginx/file/tip/src/os/unix/ngx_process_cycle.c#l220</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Maxim Dounin<br>
<a href="http://nginx.org/" rel="noreferrer" target="_blank">http://nginx.org/</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</font></span></blockquote></div><br></div></div>