diff src/os/unix/ngx_process_cycle.c @ 4917:484aec758d2c

Fixed failure to start cache manager and cache loader processes if there were more than 512 listening sockets in configuration.
author Igor Sysoev <igor@sysoev.ru>
date Tue, 20 Nov 2012 13:37:55 +0000
parents e8ef31c58d43
children f941cf265cc5
line wrap: on
line diff
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -1296,13 +1296,18 @@ ngx_cache_manager_process_cycle(ngx_cycl
     void         *ident[4];
     ngx_event_t   ev;
 
-    cycle->connection_n = 512;
-
+    /*
+     * Set correct process type since closing listening Unix domain socket
+     * in a master process also removes the Unix domain socket file.
+     */
     ngx_process = NGX_PROCESS_HELPER;
 
-    ngx_worker_process_init(cycle, -1);
+    ngx_close_listening_sockets(cycle);
 
-    ngx_close_listening_sockets(cycle);
+    /* Set a moderate number of connections for a helper process. */
+    cycle->connection_n = 512;
+
+    ngx_worker_process_init(cycle, -1);
 
     ngx_memzero(&ev, sizeof(ngx_event_t));
     ev.handler = ctx->handler;