diff options
author | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-06-16 20:23:50 +0000 |
---|---|---|
committer | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-06-16 20:23:50 +0000 |
commit | becee1168a4774c7e408797adf2490187d50d7d9 (patch) | |
tree | 0a8659d024e478af147fdd2809217fdfb359f7bc /bin | |
parent | da9243cdce5b11e4c5afb443ac8d1c35bc32eefd (diff) | |
download | unicorn-becee1168a4774c7e408797adf2490187d50d7d9.tar.gz |
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@240 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'bin')
-rw-r--r-- | bin/mongrel_rails | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/bin/mongrel_rails b/bin/mongrel_rails index b1cf737..a3e5571 100644 --- a/bin/mongrel_rails +++ b/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 end 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 end config = Mongrel::Rails::RailsConfigurator.new(settings) 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 + daemonize + 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 end + 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 "/" end - log "Starting Rails in environment #{defaults[:environment]} ..." + log "Starting Rails with #{defaults[:environment]} environment ..." uri "/", :handler => rails(:mime => mime) log "Rails loaded." |