Suggestion for reload action (USR2)

Eric Wong normalperson at
Wed Jan 20 15:03:43 EST 2010

Iñaki Baz Castillo <ibc at> wrote:
> El Miércoles, 20 de Enero de 2010, Iñaki Baz Castillo escribió:
> > This would involve just three changes:
> > 
> > - Add an option "--reload" in OptionParser in bin/unicorn.
> > - Store such option somewhere so it can be readed later by the Rack
> > application or other library.
> > - Add "--reload" to the list of original arguments when receiving USR2.

Hi Iñaki,

All you need to do is to check for the presence of ENV["UNICORN_FD"]
which is used to communicate file descriptor numbers for the upgrade

> I attach a patch (for master branch) that would do the job (except the 
> fact that I don't know how to store the "reload" option):

> (unfortunatelly I cannot attach files in this mailist as the mail is 
> rejected).

While the patch was not needed for this case, inline patches are strongly
preferred here.  Inline patches are far easier to read, reply-to and
apply than attachments.

Eric Wong

More information about the mongrel-unicorn mailing list