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/lighttpd.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/lighttpd.rb')
-rw-r--r-- | railties/lib/commands/servers/lighttpd.rb | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/railties/lib/commands/servers/lighttpd.rb b/railties/lib/commands/servers/lighttpd.rb index 34b51f21b8..1d5ca55f61 100644 --- a/railties/lib/commands/servers/lighttpd.rb +++ b/railties/lib/commands/servers/lighttpd.rb @@ -1,4 +1,5 @@ require 'rbconfig' +require 'commands/servers/base' unless RUBY_PLATFORM !~ /mswin/ && !silence_stderr { `lighttpd -version` }.blank? puts "PROBLEM: Lighttpd is not available on your system (or not in your path)" @@ -52,23 +53,7 @@ if !detach puts "=> Call with -d to detach" puts "=> Ctrl-C to shutdown server (see config/lighttpd.conf for options)" detach = false - - cursor = File.size(configuration.log_path) - last_checked = Time.now - tail_thread = Thread.new do - File.open(configuration.log_path, 'r') do |f| - loop do - f.seek cursor - if f.mtime > last_checked - last_checked = f.mtime - contents = f.read - cursor += contents.length - print contents - end - sleep 1 - end - end - end + tail_thread = tail(configuration.log_path) end trap(:INT) { exit } |