aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-02-12 17:41:53 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-02-12 17:41:53 +0000
commitb230004897770ff8e29590263ddd6416b728af3a (patch)
tree1c132644b91954776b98649c17285d1c17d44b9a /railties/lib
parentdb2023d4d2094416faa5aec7265fa21cb800b69e (diff)
downloadrails-b230004897770ff8e29590263ddd6416b728af3a.tar.gz
rails-b230004897770ff8e29590263ddd6416b728af3a.tar.bz2
rails-b230004897770ff8e29590263ddd6416b728af3a.zip
Changed default lighttpd.conf to use CWD from lighttpd 1.4.10 that allows the same configuration to be used for both detach and not. Also ensured that auto-repeaping of FCGIs only happens when lighttpd is not detached. [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3585 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/commands/servers/lighttpd.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/railties/lib/commands/servers/lighttpd.rb b/railties/lib/commands/servers/lighttpd.rb
index 5c2b5b7e84..efb7bb1c27 100644
--- a/railties/lib/commands/servers/lighttpd.rb
+++ b/railties/lib/commands/servers/lighttpd.rb
@@ -32,10 +32,10 @@ puts "=> Rails application started on http://#{ip || default_ip}:#{port || defau
tail_thread = nil
if ARGV.first == "-d"
- puts "=> Configure in config/lighttpd.conf"
+ puts "=> Configuration in config/lighttpd.conf"
detach = true
else
- puts "=> Call with -d to detach (requires absolute paths in config/lighttpd.conf)"
+ puts "=> Call with -d to detach"
puts "=> Ctrl-C to shutdown server (see config/lighttpd.conf for options)"
detach = false
@@ -62,10 +62,12 @@ trap(:INT) { exit }
begin
`lighttpd #{!detach ? "-D " : ""}-f #{config_file}`
ensure
- tail_thread.kill if tail_thread
- puts 'Exiting'
+ unless detach
+ tail_thread.kill if tail_thread
+ puts 'Exiting'
- # 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`
+ # 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
end