script/lighttpd: Detach and exit the forked process

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2877 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Sam Stephenson
2005-11-04 21:54:49 +00:00
parent 9d17e7cce4
commit f35792974a

View File

@@ -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}`