Mark Cornick
2006-Jun-13 21:46 UTC
[Mongrel] log and pid file problems when using a config file w/ -C
Hi there, I''m using Mongrel (0.3.13 prerelease, installed today) to serve up some Rails apps in production. Everything works fine if I give all the appropriate options on the command line, such as: $ mongrel_rails start -c /home/mcornick/rails/mcornick.org/current -P log/mongrel.pid -l log/mongrel.log -e production -d -a 127.0.0.1 -p 6833 So, having accomplished that, I thought it would be easier to dump all that stuff into a config file to use with the -C option. So I did this: $ mongrel_rails start -c /home/mcornick/rails/mcornick.org/current -P log/mongrel.pid -l log/mongrel.log -e production -d -a 127.0.0.1 -p 6833 -G config/mongrel.yml Which also worked, and generated a YAML file with my options: --- :cwd: /home/mcornick/rails/mcornick.org/current :includes: - mongrel :environment: production :timeout: 0 :log_file: log/mongrel.log :config_script: #:pid_file: log/mongrel.pid :num_processors: 1024 :debug: false :group: :docroot: public :user: :host: 127.0.0.1 :mime_map: :port: "6833" :daemon: true And it almost works. If I then try: $ mongrel_rails start -C /home/mcornick/rails/mcornick.org/current/config/mongrel.yml ** You have sendfile installed, will use that to serve files. !!! Path to log file not valid: log/mongrel.log start reported an error. Use mongrel_rails start -h to get help. Which makes me think the cwd option isn''t being picked up. OK, no biggie, I change directories to /home/mcornick/rails/mcornick.org/current and: $ mongrel_rails start -C config/mongrel.yml ** You have sendfile installed, will use that to serve files. ** Loading settings from config/mongrel.yml (command line options override). ** Starting Mongrel in production mode at 127.0.0.1:6833 ** Daemonizing, any open files are closed. Look at log/mongrel.pid and log/mongrel.log for info. Looks good, mongrel is running, except that the log/mongrel.pid file is not created (although the log/mongrel.log file is.) So I can''t later do mongrel_rails stop, or easily restart from my Capistrano recipe, etc. Do I have the config file syntax right? (I didn''t change any of the keys from the -G output.) Is there something else I should be doing here? BTW, I am running with Ruby 1.8.4 on FreeBSD 6.1-RELEASE. I have the sendfile gem installed, as well as mongrel_cluster which I haven''t done anything with yet, in addition to the standard set of Rails 1.1.2 gems. Thanks, --mark
Mark Cornick
2006-Jun-13 21:49 UTC
[Mongrel] log and pid file problems when using a config file w/ -C
On Tue, Jun 13, 2006 at 05:46:50PM -0400, Mark Cornick wrote:> Which also worked, and generated a YAML file with my options: > > --- > :cwd: /home/mcornick/rails/mcornick.org/current > :includes: > - mongrel > :environment: production > :timeout: 0 > :log_file: log/mongrel.log > :config_script: > #:pid_file: log/mongrel.pid > :num_processors: 1024 > :debug: false > :group: > :docroot: public > :user: > :host: 127.0.0.1 > :mime_map: > :port: "6833" > :daemon: trueOops. I left :pid_file: commented out; I had tried it that way to see if just leaving it at the default setting would help. It didn''t; I see no pid file written whether I have :pid_file: commented or not. Sorry ''bout that. --mark