From f35792974a4148d95b117777290dd720595cb48e Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Fri, 4 Nov 2005 21:54:49 +0000 Subject: script/lighttpd: Detach and exit the forked process git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2877 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/lib/commands/lighttpd.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'railties/lib') 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}` -- cgit v1.2.3