On 6/29/07, Eden Li <[EMAIL PROTECTED]> wrote:
On 6/29/07, aaron smith <[EMAIL PROTECTED]> wrote: > config.run.join is actually what keeps it running. if I do a "ps x | grep > mongrel" the process shows up.. but if I don't run config.run.join it > doesn't keep running.. Yeah, I guess I misunderstood how Daemon.daemonize works, sorry about that. > The problem still is that mongrel seems to be daemonizing correctly but > the application doesn't perform as expected, (not doing remoting > correctly).. A request comes in and no response is ever returned.. > > any ideas? I wrote a little test script that daemonizes DirHandler in the same way you're daemonizing RUBYAMF::MongrelServlet: #!/usr/bin/env ruby require 'rubygems' require 'mongrel' c = Mongrel::Configurator.new(:host => '127.0.0.1') do listener(:port => 8000) do uri("/", :handler => Mongrel::DirHandler.new('.')) end end c.daemonize(:cwd => Dir.pwd, :log_file => 'log') c.run.join This daemonizes correctly, but the log file bloats quickly with messages like: !!!!!! UNHANDLED EXCEPTION! closed stream. TELL ZED HE'S A MORON. Going back to the docs for daemonize, I read: "You must call this before frameworks that open files as otherwise the files will be closed by this function." So I put the daemonize line into the config block right before the listener block (removing the ref to c, of course), and everything works as expected. Maybe try daemonizing before you initialize your RUBYAMF handler? _______________________________________________ Mongrel-users mailing list Mongrel-users@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users
AHH. that's what it was. I even read that in the docs it just didn't click in my head. Thanks much!!!!!!
_______________________________________________ Mongrel-users mailing list Mongrel-users@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users