Welcome! Log In Create A New Profile

Advanced

Re: SIGWINCH not working on second on-the-fly binary upgrade

Maxim Dounin
November 15, 2011 12:56PM
Hello!

On Tue, Nov 15, 2011 at 02:38:31PM -0200, Eduardo Habkost wrote:

> I was trying to upgrade nginx from 1.0.9 to 1.0.10 on-the-fly, using
> the process described on the wiki[1], but it looks like it is ignoring
> the SIGWINCH signal I send to it.

[...]

> After a quick look at the code, it looks like this happened because
> the 1.0.9 process I am running was started during a previous
> 1.0.7->1.0.9 on-the-fly upgrade, and the 1.0.9 master process now
> thinks it is not daemonized (ngx_daemonized is not set on
> initialization if ngx_inherited is set).
>
> I have easily reproduced it by killing nginx completely, making a
> on-the-fly 1.0.10->1.0.10 executable upgrade twice. On the first try,
> SIGWINCH works; after the first upgrade, SIGWINCH stops working. Full
> shell session showing the bug is pasted at the end of my message.

Yes, thank you, this is a bug introduced in 1.1.1/1.0.9.

As a workaround SIGQUIT to old master process may be used (it
doesn't allow to revive old master, but allow upgrade).

The following patch should fix this:

diff --git a/src/core/nginx.c b/src/core/nginx.c
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -374,6 +374,10 @@ main(int argc, char *const *argv)
ngx_daemonized = 1;
}

+ if (ngx_inherited) {
+ ngx_daemonized = 1;
+ }
+
#endif

if (ngx_create_pidfile(&ccf->pid, cycle->log) != NGX_OK) {

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

SIGWINCH not working on second on-the-fly binary upgrade

Eduardo Habkost November 15, 2011 11:40AM

Re: SIGWINCH not working on second on-the-fly binary upgrade

Ilan Berkner November 15, 2011 11:42AM

Re: SIGWINCH not working on second on-the-fly binary upgrade

Ilan Berkner November 15, 2011 11:42AM

Re: SIGWINCH not working on second on-the-fly binary upgrade

Boyko Yordanov November 15, 2011 11:44AM

Re: SIGWINCH not working on second on-the-fly binary upgrade

Maxim Dounin November 15, 2011 12:56PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 161
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready