From d0e7d8d770275654024887a05d9e986589ba358c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 20 Mar 2012 20:05:59 +0000 Subject: log EPERM errors from invalid pid files In some cases, EPERM may indicate a real configuration problem, but it can also just mean the pid file is stale. --- lib/unicorn/http_server.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-24-ge0c7