Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

script/lighttpd: Detach and exit the forked process

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2877 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit f35792974a4148d95b117777290dd720595cb48e 1 parent 9d17e7c
@sstephenson sstephenson authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 railties/lib/commands/lighttpd.rb
View
8 railties/lib/commands/lighttpd.rb
@@ -27,15 +27,17 @@ def tail_f(input)
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}`
Please sign in to comment.
Something went wrong with that request. Please try again.