I couldn't find one that did exactly what I wanted, so I cooked up this ruby script. Be sure to change app_dir and apps near the top to match your environment. On my ubuntu/debian server, this script resides in /etc/init.d. I ran "sudo update-rc.d -f mongrel defaults" to make it run on startup.
1
2
3
4
5
6
7
8
9
10 app_dir = '/var/rails'
11
12 apps = {
13 'hpy' => 8001,
14 '43verses' => 8002
15 }
16
17 if ['stop', 'restart'].include? ARGV.first
18 apps.each do |path, port|
19 path = File.join app_dir, path
20 puts "Stopping #{path}..."
21 `mongrel_rails stop -c #{path} -P log/mongrel.pid`
22 end
23 end
24
25 if ['start', 'restart'].include? ARGV.first
26 apps.each do |path, port|
27 path = File.join app_dir, path
28 puts "Starting #{path} on #{port}..."
29 `mongrel_rails start -d -p #{port} -e production -c #{path} -P log/mongrel.pid`
30 end
31 end
32
33 unless ['start', 'stop', 'restart'].include? ARGV.first
34 puts "Usage: mongrel {start|stop|restart}"
35 exit
36 end