about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-12-28 11:16:00 -0800
committerEric Wong <normalperson@yhbt.net>2009-12-28 11:16:38 -0800
commit52eee4e424198a3c80793ee9c930fd3bb0285168 (patch)
treec3bf529ce4b1d32ff2295100003fef06b3c49410
parent36888441021fbb0ae0cf724dc4e700d316b4d1bd (diff)
downloadunicorn-52eee4e424198a3c80793ee9c930fd3bb0285168.tar.gz
Rather than erroring out with a non-descript EOFError,
show a warning message telling users to check the logs
instead.

Reported-by: IƱaki Baz Castillo mid=200912281350.44760.ibc@aliax.net
-rw-r--r--lib/unicorn/launcher.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/unicorn/launcher.rb b/lib/unicorn/launcher.rb
index 0ea836b..1871420 100644
--- a/lib/unicorn/launcher.rb
+++ b/lib/unicorn/launcher.rb
@@ -42,8 +42,11 @@ class Unicorn::Launcher
 
       if grandparent == $$
         # this will block until HttpServer#join runs (or it dies)
-        master_pid = rd.readpartial(16).to_i
-        exit!(1) unless master_pid > 1
+        master_pid = (rd.readpartial(16) rescue nil).to_i
+        unless master_pid > 1
+          warn "master failed to start, check stderr log for details"
+          exit!(1)
+        end
         exit 0
       else # unicorn master process
         options[:ready_pipe] = wr