about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2012-03-20 20:05:59 +0000
committerEric Wong <normalperson@yhbt.net>2012-03-20 20:08:15 +0000
commitd0e7d8d770275654024887a05d9e986589ba358c (patch)
treef0c75676105336b3dbd8af83db0db21a37400296
parent1e13ffee3469997286e65e0563b6433e7744388a (diff)
downloadunicorn-d0e7d8d770275654024887a05d9e986589ba358c.tar.gz
In some cases, EPERM may indicate a real configuration problem,
but it can also just mean the pid file is stale.
-rw-r--r--lib/unicorn/http_server.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index 0c2af5d..ede6264 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -656,7 +656,10 @@ class Unicorn::HttpServer
     wpid <= 0 and return
     Process.kill(0, wpid)
     wpid
-    rescue Errno::ESRCH, Errno::ENOENT, Errno::EPERM
+    rescue Errno::EPERM
+      logger.info "pid=#{path} possibly stale, got EPERM signalling PID:#{wpid}"
+      nil
+    rescue Errno::ESRCH, Errno::ENOENT
       # don't unlink stale pid files, racy without non-portable locking...
   end