aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/lib/commands/lighttpd.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/railties/lib/commands/lighttpd.rb b/railties/lib/commands/lighttpd.rb
index 6c2aeb64f9..73bd466446 100644
--- a/railties/lib/commands/lighttpd.rb
+++ b/railties/lib/commands/lighttpd.rb
@@ -27,15 +27,17 @@ else
puts "=> Ctrl-C to shutdown server (see config/lighttpd.conf for options)"
detach = false
- fork do
+ Process.detach(fork do
begin
File.open("#{RAILS_ROOT}/log/#{RAILS_ENV}.log", 'r') do |log|
- log.seek 0, IO::SEEK_END
+ log.seek(0, IO::SEEK_END)
tail_f(log) {|line| puts line}
end
rescue Exception
end
- end
+ exit
+ end)
end
+trap(:INT) {exit}
`lighttpd #{!detach ? "-D " : ""}-f #{config_file}`