mirror of
https://github.com/github/rails.git
synced 2026-02-10 22:25:02 -05:00
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:
@@ -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}`
|
||||
|
||||
Reference in New Issue
Block a user