[Mongrel] Daemonizing a camping server

Matt Zukowski mzukowski at urbacon.net
Tue Mar 13 12:32:18 EDT 2007

I'm having no luck trying to daemonize mongrel running a camping server.

When mongrel daemonizes, I get:

`accept': closed stream (IOError)

(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 => "", :log_file => 'foo.log', :cwd =>

config = Mongrel::Configurator.new settings  do
  listener :port => 12345 do
    uri '/foo', :handler => Mongrel::Camping::CampingHandler.new(CASServer)
  daemonize :log_file => 'foo.log', :cwd => $MYSERVER_HOME


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.

More information about the Mongrel-users mailing list