SIGWINCH & aborting, a cleaner solution?

Igor Sysoev igor at sysoev.ru
Thu Aug 18 14:54:28 UTC 2011


On Thu, Aug 18, 2011 at 04:43:02PM +0200, Félix Delval wrote:
> On Thu, Aug 18, 2011 at 10:29 AM, Félix Delval <felixdelval at gmail.com>wrote:
> 
> > Hello,
> >
> > I am using nginx in a terminal as development server, not as a daemon.
> >
> > Each time nginx receives the SIGWINCH signals, it says : 2011/08/18
> > 10:12:54 [alert] 12887#0: aborting
> >
> > I have seen in a email from Igor Sysoev, that he advised to modify the
> > source code and deactivate the handling<http://forum.nginx.org/read.php?2,6771>of the signal there. It works fine, but it doesn't seem to me as long-term
> > reliable solution. I know I am not the only one who has been asking about
> > this issue.
> >
> > Does somebody have solution that does not include patching?
> >
> >
> >Do you run with "daemon off" only or with master_process off" too ? I think
> SIGWINCH should just be disabled in non-daemon mode.
> 
> I only had 'deamon off', adding 'master_process off' solved my issue. I
> didn't know what that parameter was doing exactly.
> 
> I will communicate the result.
> 
> Thank you very much.

The attached patch should fix the issue.


-- 
Igor Sysoev
-------------- next part --------------
Index: src/os/unix/ngx_process.c
===================================================================
--- src/os/unix/ngx_process.c	(revision 4004)
+++ src/os/unix/ngx_process.c	(working copy)
@@ -339,8 +339,10 @@
             break;
 
         case ngx_signal_value(NGX_NOACCEPT_SIGNAL):
-            ngx_noaccept = 1;
-            action = ", stop accepting connections";
+            if (ngx_daemonized) {
+                ngx_noaccept = 1;
+                action = ", stop accepting connections";
+            }
             break;
 
         case ngx_signal_value(NGX_RECONFIGURE_SIGNAL):
@@ -392,6 +394,9 @@
         switch (signo) {
 
         case ngx_signal_value(NGX_NOACCEPT_SIGNAL):
+            if (!ngx_daemonized) {
+                break;
+            }
             ngx_debug_quit = 1;
         case ngx_signal_value(NGX_SHUTDOWN_SIGNAL):
             ngx_quit = 1;


More information about the nginx mailing list