From 52eee4e424198a3c80793ee9c930fd3bb0285168 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 28 Dec 2009 11:16:00 -0800 Subject: launcher: descriptive error message on startup failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- lib/unicorn/launcher.rb | 7 +++++-- 1 file 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 -- cgit v1.2.3-24-ge0c7