[Mongrel] mongrel not daemonizing for me..

aaron smith beingthexemplarylists at gmail.com
Tue Jun 26 19:20:02 EDT 2007


On 6/26/07, aaron smith <beingthexemplarylists at gmail.com> wrote:
>
>
> On 6/26/07, Ezra Zygmuntowicz <ezmobius at gmail.com> wrote:
> >
> >
> > On Jun 26, 2007, at 4:01 PM, aaron smith wrote:
> >
> > > Hey All,
> > >
> > > I'm setting up some mongrel servers.. can't get it to daemonize.
> > >
> > > here is my configurator block::
> > >
> > >   config = Mongrel::Configurator.new(:host => OPTIONS[:ip]) do
> > >     #debug('/gateway.rb',[:access,:threads])
> > >     listener :port => OPTIONS[:port] do
> > >       uri("/gateway.rb", :handler =>
> > > RUBYAMF::MongrelServlet.new, :num_processors => OPTIONS[:processors])
> > >     end
> > >     run.join
> > >     if OPTIONS[:daemon]
> > >       daemonize
> > >     end
> > >   end
> > >
> > > Any ideas? Also I was looking in the mongrel source and see that in
> > > the daemonize method your calling Daemon.daemonize. Is that
> > > depending on some library? I don't see it anywhere in the ruby
> > > docs. I did find this:  http://grub.ath.cx/daemonize/ and install
> > > it but that didn't seem to help.
> > >
> > > thanks
> > > Aaron
> > >
> >
> >    config = Mongrel::Configurator.new(:host => OPTIONS[:ip]) do
> >      #debug('/gateway.rb',[:access, :threads])
> >      listener :port => OPTIONS[:port] do
> >        uri("/gateway.rb", :handler =>
> > RUBYAMF::MongrelServlet.new, :num_processors => OPTIONS[:processors])
> >      end
> >      if OPTIONS[:daemon]
> >        daemonize
> >      end
> >    end
> >
> > config.run.join
> >
> >         You were doing run.join before you daemonized so the daemoinize
> > code
> > never gets called.
> >
> > Cheers-
> > -- Ezra Zygmuntowicz
> > -- Lead Rails Evangelist
> > -- ez at engineyard.com
> > -- Engine Yard, Serious Rails Hosting
> > -- (866) 518-YARD (9273)
> >
> >
> > _______________________________________________
> > Mongrel-users mailing list
> > Mongrel-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/mongrel-users
> >
>
>
> Thanks that almost got it.. couple more things:
>
>
> here is the new configurator:
>
>
>   config = Mongrel:: Configurator.new(:host => OPTIONS[:ip], :log_file =>
> '../../rubyamf_core/logs/mongrel.log') do
>     #debug('/gateway.rb',[:access,:threads])
>     listener :port => OPTIONS[:port] do
>       uri("/gateway.rb", :handler => RUBYAMF::MongrelServlet.new,
> :num_processors => OPTIONS[:processors])
>     end
>   end
>
>   if OPTIONS[:daemon]
>     config.daemonize
>   end
>
>   config.run.join
>
> ----That outputs these errors..
>
>
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1
> /lib/mongrel/configurator.rb:182:in `join': can't convert nil into String
> (TypeError)
>         from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:182:in
> `daemonize'
>
>
>
>
> Any ideas on that one?
>


Wait it was because I had set :log_file there.. I took that out now I get
these::

/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:181:in
`daemonize': undefined method `[]' for nil:NilClass (NoMethodError)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070626/4ba72534/attachment.html 


More information about the Mongrel-users mailing list