Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- # Copyright (c) 2006 Bradley Taylor, bradley@railsmachine.com
- trap("INT") do
- @servers.times do |i|
- puts "Terminating cluster #{i}"
- Process.kill "TERM", @pids[i]
- end
- end
- @pids = []
- @servers.times do |i|
- pid = fork do
- exec("mongrel_rails start --port #{(2999 + i).to_s}")
- end
- puts "mongrel pid is #{pid}"
- Process.detach pid
- @pids << pid
- end
- Process.wait
Add Comment
Please, Sign In to add comment