[Mongrel] Running some code right before the app is available to users

Zed Shaw zedshaw at zedshaw.com
Mon Sep 11 17:46:58 EDT 2006

On Mon, 2006-09-11 at 17:02 +0100, Pedro Côrte-Real wrote:
> On 8/11/06, Zed Shaw <zedshaw at zedshaw.com> wrote:
> > You could put it in a mongrel.conf and just have Mongrel run it on
> > start-up:
> >
> > mongrel_rails start -S mongrel.conf
> >
> > (Even though it ends in .conf it's actually Ruby code that gets run
> > inside the Configurator.)
> I've only now went to deploy the app and had to deal with this. The
> solution you gave works but not in the way I need it to. Mongrel will
> start listening on the port before rails starts up. The stuff I need
> to run takes a few minutes so I don't want mongrel to be listening on
> the port before the script ends. Would you consider changing this
> order and making mongrel only start listening after rails has booted?
> That's how webrick works.

The port may be open but Mongrel isn't processing any requests.  They
should queue up in the OS and then when rails is loaded Mongrel will
process them.

Zed A. Shaw
http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.

More information about the Mongrel-users mailing list