Forum: Ruby on Rails RE: Production deployment on Dreamhost?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
60e38de043848f82392062088f191213?d=identicon&s=25 Hogan, Brian P. (Guest)
on 2006-01-12 21:12
(Received via mailing list)
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.
143d37bc67b04ad4fdc69beddda48651?d=identicon&s=25 Tom Taylor (Guest)
on 2006-01-12 21:27
(Received via mailing list)
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
A242f423bb43adfb874f9685c791ffd7?d=identicon&s=25 Christopher C. Phillips (Guest)
on 2006-01-12 21:30
(Received via mailing list)
I also plan on deploying on Dreamhost within the next week.
Let us know how it goes. :)

-Chris
992fe8c19bbbc27f2b562a9f96efc03d?d=identicon&s=25 Jamis Buck (Guest)
on 2006-01-12 22:04
(Received via mailing list)
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
This topic is locked and can not be replied to.