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

Iñaki Baz Castillo ibc at aliax.net
Fri Dec 25 17:09:23 EST 2009


El Jueves, 24 de Diciembre de 2009, Eric Wong escribió:
> Iñaki Baz Castillo <ibc at aliax.net> wrote:
> > El Miércoles, 23 de Diciembre de 2009, Eric Wong escribió:
> > However I'm building my app now and when start it it usually has errors,
> > and that's good as it means I'm working :)
> > But sincerelly I would like to see the error just once rather than many
> > times due to workers respawn :)
> >
> > Also, is there any "interval" parameter so a worker is not re-spawned
> > until such timeout (after die).
> 
> You can sleep in the before_fork hook.

You mean "before_exec", rigth? :)

Yes, it's the solution :)




> I actually didn't want to support --daemonize at all since setsid(8),
> is standard most GNU/Linux distros nowadays, but we support more than
> just GNU/Linux.

AFAIK setsid is not 100% valid to daemonize a process because:

- It doesn't handle the exit return code of the process execution (it just 
returns 0 even if the process returns 1 at startup).

- It remains writting in the current stdout (the terminal in which you run 
"setsid program_name".


Thanks a lot.


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


More information about the mongrel-unicorn mailing list