diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-11-30 21:45:31 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-11-30 21:45:31 +0000 |
commit | 8dca6586ded76d5950b4fccfb720e2861efede6d (patch) | |
tree | 4a3e38a9ba2667245d6ea4bfd8e23fa5179b2848 /railties/lib | |
parent | ec75642e137a8682b099009ab205f764fe70c51e (diff) | |
download | rails-8dca6586ded76d5950b4fccfb720e2861efede6d.tar.gz rails-8dca6586ded76d5950b4fccfb720e2861efede6d.tar.bz2 rails-8dca6586ded76d5950b4fccfb720e2861efede6d.zip |
Fixed that script/server running against Mongrel should tail the proper log regardless of the environment [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5652 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/commands/servers/lighttpd.rb | 8 | ||||
-rw-r--r-- | railties/lib/commands/servers/mongrel.rb | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/railties/lib/commands/servers/lighttpd.rb b/railties/lib/commands/servers/lighttpd.rb index 07d4f9d0bf..83a2c8a8e0 100644 --- a/railties/lib/commands/servers/lighttpd.rb +++ b/railties/lib/commands/servers/lighttpd.rb @@ -11,10 +11,6 @@ unless defined?(FCGI) exit 1 end -require 'initializer' -configuration = Rails::Initializer.run(:initialize_logger).configuration -default_config_file = config_file = Pathname.new("#{RAILS_ROOT}/config/lighttpd.conf").cleanpath - require 'optparse' detach = false @@ -67,6 +63,10 @@ puts "=> Rails application starting on http://#{ip || default_ip}:#{port || defa tail_thread = nil if !detach + require 'initializer' + configuration = Rails::Initializer.run(:initialize_logger).configuration + default_config_file = config_file = Pathname.new("#{RAILS_ROOT}/config/lighttpd.conf").cleanpath + puts "=> Call with -d to detach" puts "=> Ctrl-C to shutdown server (see config/lighttpd.conf for options)" detach = false diff --git a/railties/lib/commands/servers/mongrel.rb b/railties/lib/commands/servers/mongrel.rb index e5bde9fe1b..63dd6bd71c 100644 --- a/railties/lib/commands/servers/mongrel.rb +++ b/railties/lib/commands/servers/mongrel.rb @@ -33,8 +33,11 @@ end puts "=> Rails application starting on http://#{OPTIONS[:ip]}:#{OPTIONS[:port]}" if OPTIONS[:detach] - `mongrel_rails start -d -p #{OPTIONS[:port]} -a #{OPTIONS[:ip]} -e #{OPTIONS[:environment]}` + `mongrel_rails start -d -p #{OPTIONS[:port]} -a #{OPTIONS[:ip]} -e #{OPTIONS[:environment]} -P #{RAILS_ROOT}/tmp/pids/mongrel.pid` else + ENV["RAILS_ENV"] = OPTIONS[:environment] + RAILS_ENV.replace(OPTIONS[:environment]) if defined?(RAILS_ENV) + require 'initializer' Rails::Initializer.run(:initialize_logger) |