Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 86
- Log:
Initial import of I2, an Instiki clone.
- Author:
- adh
- Date:
- Mon Oct 16 10:40:36 +0100 2006
- Size:
- 2158 Bytes
- Properties:
- Property svn:executable is set
1 | #!/usr/local/bin/ruby |
2 | |
3 | require 'optparse' |
4 | |
5 | def spawn(port) |
6 | print "Starting FCGI on port: #{port}\n " |
7 | system("#{OPTIONS[:spawner]} -f #{OPTIONS[:dispatcher]} -p #{port}") |
8 | end |
9 | |
10 | OPTIONS = { |
11 | :environment => "production", |
12 | :spawner => '/usr/bin/env spawn-fcgi', |
13 | :dispatcher => File.expand_path(File.dirname(__FILE__) + '/../../public/dispatch.fcgi'), |
14 | :port => 8000, |
15 | :instances => 3 |
16 | } |
17 | |
18 | ARGV.options do |opts| |
19 | opts.banner = "Usage: spawner [options]" |
20 | |
21 | opts.separator "" |
22 | |
23 | opts.on <<-EOF |
24 | Description: |
25 | The spawner is a wrapper for spawn-fcgi that makes it easier to start multiple FCGI |
26 | processes running the Rails dispatcher. The spawn-fcgi command is included with the lighttpd |
27 | web server, but can be used with both Apache and lighttpd (and any other web server supporting |
28 | externally managed FCGI processes). |
29 | |
30 | You decide a starting port (default is 8000) and the number of FCGI process instances you'd |
31 | like to run. So if you pick 9100 and 3 instances, you'll start processes on 9100, 9101, and 9102. |
32 | |
33 | Examples: |
34 | spawner # starts instances on 8000, 8001, and 8002 |
35 | spawner -p 9100 -i 10 # starts 10 instances counting from 9100 to 9109 |
36 | EOF |
37 | |
38 | opts.on(" Options:") |
39 | |
40 | opts.on("-p", "--port=number", Integer, "Starting port number (default: #{OPTIONS[:port]})") { |OPTIONS[:port]| } |
41 | opts.on("-i", "--instances=number", Integer, "Number of instances (default: #{OPTIONS[:instances]})") { |OPTIONS[:instances]| } |
42 | opts.on("-e", "--environment=name", String, "test|development|production (default: #{OPTIONS[:environment]})") { |OPTIONS[:environment]| } |
43 | opts.on("-s", "--spawner=path", String, "default: #{OPTIONS[:spawner]}") { |OPTIONS[:spawner]| } |
44 | opts.on("-d", "--dispatcher=path", String, "default: #{OPTIONS[:dispatcher]}") { |dispatcher| OPTIONS[:dispatcher] = File.expand_path(dispatcher) } |
45 | |
46 | opts.separator "" |
47 | |
48 | opts.on("-h", "--help", "Show this help message.") { puts opts; exit } |
49 | |
50 | opts.parse! |
51 | end |
52 | |
53 | ENV["RAILS_ENV"] = OPTIONS[:environment] |
54 | OPTIONS[:instances].times { |i| spawn(OPTIONS[:port] + i) } |