nginx on Tru64/alpha

Igor Sysoev is at rambler-co.ru
Tue Feb 24 09:44:30 MSK 2009


On Mon, Feb 23, 2009 at 08:22:24PM -0600, Dustin Marquess wrote:

> On Mon, Feb 23, 2009 at 3:09 AM, Igor Sysoev <is at rambler-co.ru> wrote:
> > On Sun, Feb 22, 2009 at 05:49:31PM -0600, Dustin Marquess wrote:
> >
> >> I recently installed nginx 0.7.37 on Tru64 5.1B-4 using Compaq C
> >> V6.5-303 compiler.
> >>
> >> Everything works great if I leave the default of worker_processes set
> >> to 1.  However, if I increase it to 2 (since this machine has 2 CPUs),
> >> I immediately start getting a flood of fcntl errors in the error.log.
> >>
> >> Running truss on the process shows that both processes attempt to lock
> >> the same nginx.lock.accept file, which is what causes the problem.
> >
> > Could you shou the error messages ?
> 
> The log file shows:
> 
> 2009/02/24 02:17:02 [alert] 438988#0: fcntl(F_SETLK, F_WRLCK) failed
> (13: Permission denied)
> 2009/02/24 02:17:03 [alert] 438988#0: fcntl(F_SETLK, F_WRLCK) failed
> (13: Permission denied)
> 2009/02/24 02:17:03 [alert] 438988#0: fcntl(F_SETLK, F_WRLCK) failed
> (13: Permission denied)
> 
> Truss shows:
> 
> 438988: fcntl(7, F_SETLK, 0x000000011FFFBC28)           Err#13 Permission denied
> 
> going farther back in the truss shows that fd 7 is the mutex:
> 
> 438988: open("/usr/local/nginx/logs/nginx.lock.accept",
> O_RDWR|O_CREAT, 0644) = 7
> 438988: unlink("/usr/local/nginx/logs/nginx.lock.accept") = 0

The attached patch should help.


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
Index: src/core/ngx_shmtx.h
===================================================================
--- src/core/ngx_shmtx.h	(revision 1850)
+++ src/core/ngx_shmtx.h	(working copy)
@@ -57,8 +57,16 @@
         return 0;
     }
 
-    ngx_log_abort(err, ngx_trylock_fd_n " failed");
+#if __osf__ /* Tru64 UNIX */
 
+    if (err == NGX_EACCESS) {
+        return 0;
+    }
+
+#endif
+
+    ngx_log_abort(err, ngx_trylock_fd_n " %s failed", mtx->name);
+
     return 0;
 }
 
@@ -74,7 +82,7 @@
         return;
     }
 
-    ngx_log_abort(err, ngx_lock_fd_n " failed");
+    ngx_log_abort(err, ngx_lock_fd_n " %s failed", mtx->name);
 }
 
 
@@ -89,7 +97,7 @@
         return;
     }
 
-    ngx_log_abort(err, ngx_unlock_fd_n " failed");
+    ngx_log_abort(err, ngx_unlock_fd_n " %s failed", mtx->name);
 }
 
 


More information about the nginx mailing list