diff options
author | Sam Stephenson <sam@37signals.com> | 2005-11-04 21:54:49 +0000 |
---|---|---|
committer | Sam Stephenson <sam@37signals.com> | 2005-11-04 21:54:49 +0000 |
commit | f35792974a4148d95b117777290dd720595cb48e (patch) | |
tree | 1f6960f1525a2ac63f06fa73d6afe7df5c163807 /railties/lib | |
parent | 9d17e7cce46f7758abab6ac158f8c10b0987d0e2 (diff) | |
download | rails-f35792974a4148d95b117777290dd720595cb48e.tar.gz rails-f35792974a4148d95b117777290dd720595cb48e.tar.bz2 rails-f35792974a4148d95b117777290dd720595cb48e.zip |
script/lighttpd: Detach and exit the forked process
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2877 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/commands/lighttpd.rb | 8 |
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}` |