Browse files

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.
  • Loading branch information...
1 parent 1e13ffe commit d0e7d8d770275654024887a05d9e986589ba358c Eric Wong committed Mar 20, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/unicorn/http_server.rb
@@ -656,7 +656,10 @@ def valid_pid?(path)
wpid <= 0 and return
Process.kill(0, wpid)
- rescue Errno::ESRCH, Errno::ENOENT, Errno::EPERM
+ rescue Errno::EPERM
+ "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...

0 comments on commit d0e7d8d

Please sign in to comment.