summary refs log tree commit homepage
diff options
context:
space:
mode:
authorIƱaki Baz Castillo <ibc@aliax.net>2009-12-28 15:46:26 -0800
committerEric Wong <normalperson@yhbt.net>2009-12-28 15:57:14 -0800
commit1a0f0688bb2257c6db8e8a3f41b9a41641c2db3f (patch)
tree778e47da923a4c4a415763740c2d27e25822d1b2
parent643994afcdbd4121c0d131a87052cdd17d40e54f (diff)
When using multiple listeners, the log messages can be
potentially misleading as to which listener fails to bind:

Before:

  INFO -- : unlinking existing socket=/tmp/unicorn.sock
  INFO -- : listening on addr=/tmp/unicorn.sock fd=3
  unicorn/socket_helper.rb:110:in `initialize': Permission denied - bind(2) (Errno::EACCES)

After:

  INFO -- : unlinking existing socket=/tmp/openxdms.sock
  INFO -- : listening on addr=/tmp/openxdms.sock fd=3
  FATAL -- : error adding listener addr=0.0.0.0:84
  unicorn/socket_helper.rb:110:in `initialize': Permission denied - bind(2) (Errno::EACCES)
-rw-r--r--lib/unicorn.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index 71d5994..225e00a 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -306,6 +306,9 @@ module Unicorn
                      "(#{tries < 0 ? 'infinite' : tries} tries left)"
         sleep(delay)
         retry
+      rescue => err
+        logger.fatal "error adding listener addr=#{address}"
+        raise err
       end
     end