Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Cleaned up the logging output to be more 'unix style'. Give a big war…

…ning if you try to run twice in daemon mode.

git-svn-id: svn+ssh:// 19e92222-5c0b-0410-8929-a290d50e31e9
  • Loading branch information...
1 parent da9243c commit becee1168a4774c7e408797adf2490187d50d7d9 zedshaw committed
Showing with 12 additions and 5 deletions.
  1. +12 −5 bin/mongrel_rails
17 bin/mongrel_rails
@@ -65,22 +65,29 @@ class Start < GemPlugin::Plugin "/commands"
if @generate
STDERR.puts "** Writing config to #@generate"
open(@generate, "w") {|f| f.write(settings.to_yaml) }
+ STDERR.puts "## Exiting. Re-run without -G and WITH -C using your new config file."
+ exit 0
if @config_file
- STDERR.puts "** Loading settings from #{@config_file} (command line options override)."
+ STDERR.puts "** Loading settings from #{@config_file} (they override command line)." unless defaults[:daemon]
conf = YAML.load_file(@config_file)
settings = settings.merge! conf
config = do
- log "Starting Mongrel in #{defaults[:environment]} mode at #{defaults[:host]}:#{defaults[:port]}"
if defaults[:daemon]
- log "Daemonizing, any open files are closed. Look at #{defaults[:pid_file]} and #{defaults[:log_file]} for info."
+ if File.exist? defaults[:pid_file]
+ log "!!! PID file #{defaults[:pid_file]} already exists. Mongrel could be running already. Check your #{defaults[:log_file]} for errors."
+ end
+ log "Daemonized, any open files are closed. Look at #{defaults[:pid_file]} and #{defaults[:log_file]} for info."
+ log "Settings loaded from #{@config_file} (they override command line)." if @config_file
+ log "Starting Mongrel listening at #{defaults[:host]}:#{defaults[:port]}"
listener do
mime = {}
if defaults[:mime_map]
@@ -93,7 +100,7 @@ class Start < GemPlugin::Plugin "/commands"
debug "/"
- log "Starting Rails in environment #{defaults[:environment]} ..."
+ log "Starting Rails with #{defaults[:environment]} environment ..."
uri "/", :handler => rails(:mime => mime)
log "Rails loaded."

0 comments on commit becee11

Please sign in to comment.
Something went wrong with that request. Please try again.