[Mongrel] Daemonizing a camping server

Matt Zukowski mzukowski at urbacon.net
Wed Mar 14 11:23:41 EDT 2007


I didn't get any responses to my previous post about this, so I figure
maybe I'm not explaining myself clearly enough. My problem is fairly
simple. I'm trying to run a Camping server as a background (daemon)
process. I'm using Mongrel configurator's "daemonize()" method to do
this. However, when I daemonize the server, I got a huge spew of:

!!!!!! UNHANDLED EXCEPTION! closed stream.  TELL ZED HE'S A MORON.
!!!!!! UNHANDLED EXCEPTION! closed stream.  TELL ZED HE'S A MORON.
!!!!!! UNHANDLED EXCEPTION! closed stream.  TELL ZED HE'S A MORON.
!!!!!! UNHANDLED EXCEPTION! closed stream.  TELL ZED HE'S A MORON.
!!!!!! UNHANDLED EXCEPTION! closed stream.  TELL ZED HE'S A MORON.
!!!!!! UNHANDLED EXCEPTION! closed stream.  TELL ZED HE'S A MORON.
!!!!!! UNHANDLED EXCEPTION! closed stream.  TELL ZED HE'S A MORON.
!!!!!! UNHANDLED EXCEPTION! closed stream.  TELL ZED HE'S A MORON.
!!!!!! UNHANDLED EXCEPTION! closed stream.  TELL ZED HE'S A MORON.

See below for details on what I'm doing, how I'm doing it, and what I
think is the culprit (hint: IOError in mongrel.rb line 723).

Thanks,
Matt.

Matt Zukowski wrote:
> I'm having no luck trying to daemonize mongrel running a camping server.
> 
> When mongrel daemonizes, I get:
> 
> /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:723:in
> `accept': closed stream (IOError)
>         from
> /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:293:in
> `join'
> ...
> 
> (This was after I disabled the unhandled exception catchall in the
> mongrel code -- otherwise it would just spew "!!!UNHANDLED EXCEPTION --
> TELL ZED HE'S A MORON" ... or something to that effect).
> 
> Here's how I'm daemonizing the server. I scraped this together from the
> code in mongrel_rails as well as rv:
> 
> settings = {:host => "0.0.0.0", :log_file => 'foo.log', :cwd =>
> $MYSERVER_HOME}
> 
> config = Mongrel::Configurator.new settings  do
>   listener :port => 12345 do
>     uri '/foo', :handler => Mongrel::Camping::CampingHandler.new(CASServer)
>     setup_signals
>   end
>   daemonize :log_file => 'foo.log', :cwd => $MYSERVER_HOME
> end
> 
> config.run
> config.join
> 
> 
> The server works just fine if I comment out the "daemonize" call, but
> doesn't work at all when daemonized.
> 
> Any ideas?
> 
> 
> This e-mail message is privileged, confidential and subject to copyright. Any unauthorized use or disclosure is prohibited. 
> Le contenu du pr'esent courriel est privil'egi'e, confidentiel et soumis `a des droits d'auteur. Il est interdit de l'utiliser ou de le divulguer sans autorisation.
> 
> 
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users



More information about the Mongrel-users mailing list