[Mongrel] Mongrel loading wrong database environment (& a couple other bugs?)

John Clayton john at fivesquaresoftware.com
Mon Aug 14 17:33:16 EDT 2006

Hi There,

I've got a mongrel cluster running on redhat 9 proxied behind an  
Apache 2.2 installation.  I have run into a real stumbling block in  
that, while the rails app runs in production mode (you get a  
production.log file, for example, and I see this in the mongrel log:  
** Starting Rails with production environment ... ), it always loads  
the development database configuration no matter what. I can re- 
config the file, move things around, with no effect.  Has anyone else  
noticed this?

I'm starting up mongrel using the mongrel_cluster_ctl script from /et/ 
init.d/mongrel_cluster as suggested in the docs. You can see my  
config file below.

I've also noticed a couple other issues.

1. When specifying a pid file that's not in the default, you can  
start up mongrel fine and it writes the pid(s, this is clustered) to  
the correct location, say /tmp/mongrel.*.pid, but the stop command  
always tries to find the pid in /path/to/docroot/log/tmp/ 
mongrel.*.pid, basically appending the absolute path to the default  

This is handy if you want to move symlinks around and still have the  
ctl script find the pids.

2. the -r (--root) option and the :docroot yml pair don't seem to  
have any effect whatsoever.

Thanks for any help you can offer,

John Clayton

My mongrel versions:

mongrel (
     A small fast HTTP library and server that runs Rails, Camping, and
     Nitro apps.

mongrel_cluster (0.2.0)
     Mongrel plugin that provides commands and Capistrano tasks for
     managing multiple Mongrel processes.

My config file:

user: mongrel
cwd: /var/www/example.com/app/current/
port: "8000"
environment: production
debug: false
group: instrument
pid_file: log/mongrel.pid
servers: 3

More information about the Mongrel-users mailing list