about summary refs log tree commit homepage
diff options
context:
space:
mode:
-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