"unicorn -D" always returns 0 "success" (even when failed to load)

Iñaki Baz Castillo ibc at aliax.net
Mon Dec 28 15:41:51 EST 2009


El Lunes, 28 de Diciembre de 2009, Eric Wong escribió:
> Iñaki Baz Castillo <ibc at aliax.net> wrote:
> > El Lunes, 28 de Diciembre de 2009, Eric Wong escribió:
> > > > As a suggestion, could the grandparent rescue such exception and
> > > > display some  kind of error message?:
> > > >
> > > >   "The master couldn't be started. Inspect the log error or run in
> > > > foreground"
> > >
> > > Thanks, pushed out to the ready_pipe branch of unicorn.git
> >
> > Hi, I attach a minor patch to make the error more verbose when Unicorn
> > cannot listen in a socket.
> 
> Hi, it seems like you didn't attach the patch.

Ops, usually my mail client (Kmail) warns me when I write tha word "attach" 
but attach nothing... not sure why it didn't it this time.


> Attaching patches is
> strongly discouraged, though, inline patches are far easier to
> review/edit/apply.

Ok, here it's (note that it's done over 'ready_pipe' branch):


--- unicorn.rb.orig     2009-12-28 21:02:47.000000000 +0100
+++ unicorn.rb  2009-12-28 21:11:12.000000000 +0100
@@ -307,6 +307,9 @@
                      "(#{tries < 0 ? 'infinite' : tries} tries left)"
         sleep(delay)
         retry
+      rescue => err
+        logger.fatal "error adding listener addr=#{address}"
+        raise err
       end
     end


-- 
Iñaki Baz Castillo <ibc at aliax.net>


More information about the mongrel-unicorn mailing list