aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/commands/servers
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-03-04 19:39:26 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-03-04 19:39:26 +0000
commiteb01d35109897162a48ff5219dcd97f35328168c (patch)
tree8ce1d54d29dff34550b33bc5b6696945d8876ca1 /railties/lib/commands/servers
parentc0fb67c0f88bb81f525185a8dfceec6fb7cb298e (diff)
downloadrails-eb01d35109897162a48ff5219dcd97f35328168c.tar.gz
rails-eb01d35109897162a48ff5219dcd97f35328168c.tar.bz2
rails-eb01d35109897162a48ff5219dcd97f35328168c.zip
Added socket cleanup for lighttpd, both before and after [DHH] Added automatic creation of tmp/ when running script/server [DHH] Added silence_stream that'll work on both STDERR or STDOUT or any other stream and deprecated silence_stderr in the process [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3761 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/commands/servers')
-rw-r--r--railties/lib/commands/servers/lighttpd.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/railties/lib/commands/servers/lighttpd.rb b/railties/lib/commands/servers/lighttpd.rb
index 2bd9a1de14..315fb34ade 100644
--- a/railties/lib/commands/servers/lighttpd.rb
+++ b/railties/lib/commands/servers/lighttpd.rb
@@ -72,6 +72,7 @@ end
trap(:INT) { exit }
begin
+ `rake tmp:sockets:clear` # Needed if lighttpd crashes or otherwise leaves FCGI sockets around
`lighttpd #{!detach ? "-D " : ""}-f #{config_file}`
ensure
unless detach
@@ -79,7 +80,11 @@ ensure
puts 'Exiting'
# Ensure FCGI processes are reaped
- ARGV.replace ['-a', 'kill']
- require 'commands/process/reaper'
+ silence_stream(STDOUT) do
+ ARGV.replace ['-a', 'kill']
+ require 'commands/process/reaper'
+ end
+
+ `rake tmp:sockets:clear` # Remove sockets on clean shutdown
end
end