Permalink
Browse files

Updated documentation and fixed the spinner to reference the new spaw…

…ner by default

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2610 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 0930256 commit 50f3c3cc40bc3e1fffe37f9f2c6b51385cc94af9 @dhh dhh committed Oct 15, 2005
Showing with 10 additions and 21 deletions.
  1. +2 −5 railties/lib/commands/process/reaper.rb
  2. +8 −16 railties/lib/commands/process/spinner.rb
@@ -90,13 +90,10 @@ def to_s
Restart is the most common and default action.
- A nudge is simply a request to a URL where the dispatcher is serving. You should perform one nudge per
- FCGI process you have running if they're setup in a round-robin. Be sure to do one nudge per FCGI process
- across all your servers. So three servers with 10 processes each should nudge 30 times to be sure all processes
- are restarted.
-
Examples:
+ reaper # restarts the default dispatcher
reaper -a reload
+ reaper -a exit -d /my/special/dispatcher.fcgi
EOF
opts.on(" Options:")
@@ -12,10 +12,9 @@ def daemonize
end
OPTIONS = {
- :high_interval => 5.0,
- :low_interval => 0.5,
- :command => File.expand_path(RAILS_ROOT + '/script/run process spawner'),
- :daemon => false
+ :interval => 5.0,
+ :command => File.expand_path(RAILS_ROOT + '/script/process/spawner'),
+ :daemon => false
}
ARGV.options do |opts|
@@ -26,7 +25,7 @@ def daemonize
opts.on <<-EOF
Description:
The spinner is a protection loop for the spawner, which will attempt to restart any FCGI processes
- that might have been restarted or outright crashed. It's a brute-force attempt that'll just try
+ that might have been exited or outright crashed. It's a brute-force attempt that'll just try
to run the spawner every X number of seconds, so it does pose a light load on the server.
Examples:
@@ -37,10 +36,9 @@ def daemonize
opts.on(" Options:")
- opts.on("-c", "--command=path", String) { |OPTIONS[:command]| }
- opts.on("-h", "--high-interval=seconds", Float) { |OPTIONS[:high_interval]| }
- opts.on("-l", "--low-interval=seconds", Float) { |OPTIONS[:low_interval]| }
- opts.on("-d", "--daemon") { |OPTIONS[:daemon]| }
+ opts.on("-c", "--command=path", String) { |OPTIONS[:command]| }
+ opts.on("-i", "--interval=seconds", Float) { |OPTIONS[:interval]| }
+ opts.on("-d", "--daemon") { |OPTIONS[:daemon]| }
opts.separator ""
@@ -52,14 +50,8 @@ def daemonize
daemonize if OPTIONS[:daemon]
trap(OPTIONS[:daemon] ? "TERM" : "INT") { exit }
-trap("USR1") do
- $interval = ($interval == OPTIONS[:high_interval] ? OPTIONS[:low_interval] : OPTIONS[:high_interval])
- puts "New interval: #{$interval}"
-end
-
-$interval = OPTIONS[:high_interval]
loop do
system(OPTIONS[:command])
- sleep($interval)
+ sleep(OPTIONS[:interval])
end

0 comments on commit 50f3c3c

Please sign in to comment.