RE: Production deployment on Dreamhost?

Tom:

I’m running a small app in production there… They did something crazy
to their FCGI sweeper a few months back but a nice fellow came up with a
hack but in order to use it you’ll need to freeze your rails so you can
modify the fcti_handler.

ruby/gems/1.8/gems/rails-1.0/lib/fcgi_handler.rb

Find this file and make the “exit_now_handler” method look like this:

def exit_now_handler(signal)
dispatcher_log :info, “asked to terminate immediately”
## force to restart
dispatcher_log :info, “but we will restart”
restart_handler(signal)
#exit
end

Now my app basically stays alive and works pretty well. I haven’t looked
into whether they have fixed anything out there or not, but this is my
solution.

Hogan, Brian P. wrote:

Tom:

I’m running a small app in production there… They did something crazy
to their FCGI sweeper a few months back but a nice fellow came up with a
hack but in order to use it you’ll need to freeze your rails so you can
modify the fcti_handler.

Thanks Brian,

I’ll give that a shot when I try and deploy it this weekend.

Tom

I also plan on deploying on Dreamhost within the next week.
Let us know how it goes. :slight_smile:

-Chris

On Jan 12, 2006, at 1:10 PM, Hogan, Brian P. wrote:

 #exit

end

Now my app basically stays alive and works pretty well. I haven’t
looked
into whether they have fixed anything out there or not, but this is my
solution.

Note that you can do this without freezing your rails. In your
dispatch.fcgi, just after the ‘require “fcgi_handler”’ bit, you can
reopen the class and redefine the handler:

class RailsFCGIHandler
def exit_now_handler(signal)

end
end

RailsFCGIHandler.process!

Gotta love Ruby!

  • Jamis