about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-06-14 23:25:43 +0000
committerEric Wong <normalperson@yhbt.net>2011-06-14 23:48:41 +0000
commitf1d8dd94122395cd7b072aeec8942f2cd6b8ca99 (patch)
tree55165177795d7c3bf730d37b61b4a5b8740f678d
parent2f3c135b15e6603e71bb9d6d054e5cd606c7b2b6 (diff)
downloadunicorn-f1d8dd94122395cd7b072aeec8942f2cd6b8ca99.tar.gz
Oops, it messes logging up badly.
-rw-r--r--lib/unicorn/http_server.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index 66b137f..d0a8dfc 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -505,15 +505,16 @@ class Unicorn::HttpServer
       if pid = fork
         WORKERS[pid] = worker
       else
-        begin
-          after_fork_internal
-          worker_loop(worker)
-          exit(0)
-        rescue Object
-          exit!(1)
-        end
+        after_fork_internal
+        worker_loop(worker)
+        exit(0)
       end
     end
+    rescue SystemExit => e
+      exit!(e.status)
+    rescue => e
+      @logger.error(e) rescue nil
+      exit!(1)
   end
 
   def maintain_worker_count