# Master process on reload

**URL:** <https://www.ruby-forum.com/t/master-process-on-reload/244868>\
**Category:** NGINX\
**Created:** [June 29, 2016, 7:05pm UTC](https://www.ruby-forum.com/t/master-process-on-reload/244868 "2016-06-29T19:05:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [June 29, 2016, 7:05pm UTC](https://www.ruby-forum.com/t/master-process-on-reload/244868/1 "2016-06-29T19:05:57Z")

</div>

Hello,

Kind of basic question about nginx behavior here.

On the docs page [Controlling nginx](http://nginx.org/en/docs/control.html), it is said :

> HUP → changing configuration, keeping up with a changed time zone (only  
> for FreeBSD and Linux), starting new worker processes with a new  
> configuration, graceful shutdown of old worker processes

This is exact since the HUP signal is used to reload configuration and  
spawn new workers with it.

However, a little bit further on the same page, in the on-the-fly  
upgrade  
section, you got:

> Send the HUP signal to the old master process. The old master process will  
> start new worker processes without re-reading the configuration. After  
> that, all new processes can be shut down gracefully, by sending the QUIT  
> signal to the new master process.

## Is this behavior due to the USR2 signal previously sent, the old master knowing it is the old one (and thus knowing it should avoid loading an improper configuration suitable for another version)?

_B. R._

---

<div class="post-metadata">

**Author:** ![B.R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3be4f8/32.png) [@B.R](https://www.ruby-forum.com/u/B.R)\
**Post date:** [June 29, 2016, 7:39pm UTC](https://www.ruby-forum.com/t/master-process-on-reload/244868/2 "2016-06-29T19:39:16Z")

</div>

Hello!

On Wed, Jun 29, 2016 at 07:04:48PM +0200, B.R. wrote:

> improper configuration suitable for another version)?  
> Yes. The old master knows it previously started a new master,  
> and on the HUP signal it just starts new workers (if the new  
> master is still running). If/when the old master exits, the old  
> master is notified about this, and starts to work normally.

Additional details can be found in  
src/os/unix/ngx\_process\_cycle.c:

> **[hg.nginx.org is decommissioned](http://hg.nginx.org/nginx/file/tip/src/os/unix/ngx_process_cycle.c#l220)**

–  
Maxim D.

> **[nginx](http://nginx.org/)**

---

<div class="post-metadata">

**Author:** ![B.R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3be4f8/32.png) [@B.R](https://www.ruby-forum.com/u/B.R)\
**Post date:** [June 29, 2016, 9:36pm UTC](https://www.ruby-forum.com/t/master-process-on-reload/244868/3 "2016-06-29T21:36:06Z")

</div>

## Thanks Maxim! Helpful and concise as always. :o)

_B. R._
