aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorSam Stephenson <sam@37signals.com>2006-01-12 23:57:44 +0000
committerSam Stephenson <sam@37signals.com>2006-01-12 23:57:44 +0000
commit7fbfc5ab61de3ac36d71a6501e9d2ca51e6b9d83 (patch)
tree9f6fcb9971fb32745819718fe9a1c2239f288daa /railties
parent751b6be46481d7f149c909e63096b96c37b3d68f (diff)
downloadrails-7fbfc5ab61de3ac36d71a6501e9d2ca51e6b9d83.tar.gz
rails-7fbfc5ab61de3ac36d71a6501e9d2ca51e6b9d83.tar.bz2
rails-7fbfc5ab61de3ac36d71a6501e9d2ca51e6b9d83.zip
Reap FCGI processes after lighttpd exits
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3398 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/lib/commands/servers/lighttpd.rb14
2 files changed, 14 insertions, 2 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index 09961301c7..9c5073ae1f 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Reap FCGI processes after lighttpd exits. [Sam Stephenson]
+
* Update to script.aculo.us to 1.5.0 rev. 3343 [Thomas Fuchs]
* Honor ActiveRecord::Base.pluralize_table_names when creating and destroying session store table. #3204. [rails@bencurtis.com, Marcel Molina Jr.]
diff --git a/railties/lib/commands/servers/lighttpd.rb b/railties/lib/commands/servers/lighttpd.rb
index 8f67721a04..7d2682cb97 100644
--- a/railties/lib/commands/servers/lighttpd.rb
+++ b/railties/lib/commands/servers/lighttpd.rb
@@ -1,3 +1,5 @@
+require 'rbconfig'
+
unless RUBY_PLATFORM !~ /mswin/ && !silence_stderr { `lighttpd -version` }.blank?
puts "PROBLEM: Lighttpd is not available on your system (or not in your path)"
exit 1
@@ -56,5 +58,13 @@ else
end
trap(:INT) { exit }
-`lighttpd #{!detach ? "-D " : ""}-f #{config_file}`
-tail_thread.kill if tail_thread
+
+begin
+ `lighttpd #{!detach ? "-D " : ""}-f #{config_file}`
+ensure
+ tail_thread.kill if tail_thread
+
+ # Ensure FCGI processes are reaped
+ path_to_ruby = "#{Config::CONFIG['bindir']}/#{Config::CONFIG['ruby_install_name']}"
+ `#{path_to_ruby} #{RAILS_ROOT}/script/process/reaper -a kill`
+end