diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-06-29 00:31:45 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-06-29 00:31:45 +0000 |
commit | 0a072e8ed7256c8d555be1b6c910767c3578cd50 (patch) | |
tree | 32be5bf93a0af6ecd9f62d10581775c3ad28ab68 /railties/lib/commands/servers/mongrel.rb | |
parent | ce458a74a5f95bb09c4e6b6dbd62367d767af18e (diff) | |
download | rails-0a072e8ed7256c8d555be1b6c910767c3578cd50.tar.gz rails-0a072e8ed7256c8d555be1b6c910767c3578cd50.tar.bz2 rails-0a072e8ed7256c8d555be1b6c910767c3578cd50.zip |
Mongrel: script/server tails the rails log like it does with lighttpd. Closes #5541.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4506 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/commands/servers/mongrel.rb')
-rw-r--r-- | railties/lib/commands/servers/mongrel.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/railties/lib/commands/servers/mongrel.rb b/railties/lib/commands/servers/mongrel.rb index b46923eb8f..a110cac7c4 100644 --- a/railties/lib/commands/servers/mongrel.rb +++ b/railties/lib/commands/servers/mongrel.rb @@ -1,4 +1,5 @@ require 'rbconfig' +require 'commands/servers/base' unless defined?(Mongrel) puts "PROBLEM: Mongrel is not available on your system (or not in your path)" @@ -26,16 +27,19 @@ end default_port, default_ip = 3000, '0.0.0.0' puts "=> Rails application started on http://#{ip || default_ip}:#{port || default_port}" +log_file = Pathname.new("#{RAILS_ROOT}/log/#{RAILS_ENV}.log").cleanpath + +tail_thread = nil + if !detach puts "=> Call with -d to detach" puts "=> Ctrl-C to shutdown server" detach = false + tail_thread = tail(log_file) end trap(:INT) { exit } -tail_thread = nil - begin ARGV.unshift("start") load 'mongrel_rails' |