about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/unicorn.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index c2ac09d..a049b5c 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -471,7 +471,7 @@ module Unicorn
       [:TERM, :INT].each { |sig| trap(sig) { exit(0) } } # instant shutdown
       @logger.info "worker=#{worker.nr} ready"
 
-      while alive && master_pid == Process.ppid
+      while alive
         if nr < 0
           @logger.info "worker=#{worker.nr} reopening logs..."
           Unicorn::Util.reopen_logs
@@ -517,6 +517,7 @@ module Unicorn
           if nr != 0 # (nr < 0) => reopen logs
             ready = LISTENERS
           else
+            master_pid == Process.ppid or exit(0)
             begin
               alive.chmod(nr += 1)
               # timeout used so we can detect parent death: