Skip to content
This repository
Browse code

Added -n/--process to script/process/spawner name the process pid (de…

…fault is dispatch) [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4322 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit d1d8657ea6bfce2f5442608ed0fd0dfcf53f6f6f 1 parent 0bc2485
David Heinemeier Hansson authored May 02, 2006
2  railties/CHANGELOG
... ...
@@ -1,5 +1,7 @@
1 1
 *SVN*
2 2
 
  3
+* Added -n/--process to script/process/spawner name the process pid (default is dispatch) [DHH]
  4
+
3 5
 * Namespaced OrderedHash so the Rails implementation does not clash with any others. (fixes #4911) [Julian Tarkhanov]
4 6
 
5 7
 * Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.]
4  railties/lib/commands/process/spawner.rb
@@ -43,7 +43,7 @@ def self.spawn_all
43 43
 
44 44
 class FcgiSpawner < Spawner
45 45
   def self.spawn(port)
46  
-    system("#{OPTIONS[:spawner]} -f #{OPTIONS[:dispatcher]} -p #{port} -P #{OPTIONS[:pids]}/dispatch.#{port}.pid")
  46
+    system("#{OPTIONS[:spawner]} -f #{OPTIONS[:dispatcher]} -p #{port} -P #{OPTIONS[:pids]}/#{OPTIONS[:process]}.#{port}.pid")
47 47
   end
48 48
 end
49 49
 
@@ -59,6 +59,7 @@ def self.spawn(port)
59 59
   :spawner     => '/usr/bin/env spawn-fcgi',
60 60
   :dispatcher  => File.expand_path(RAILS_ROOT + '/public/dispatch.fcgi'),
61 61
   :pids        => File.expand_path(RAILS_ROOT + "/tmp/pids"),
  62
+  :process     => "dispatch",
62 63
   :port        => 8000,
63 64
   :instances   => 3,
64 65
   :repeat      => nil
@@ -94,6 +95,7 @@ def self.spawn(port)
94 95
   opts.on("-i", "--instances=number", Integer, "Number of instances (default: #{OPTIONS[:instances]})")            { |OPTIONS[:instances]| }
95 96
   opts.on("-r", "--repeat=seconds",   Integer, "Repeat spawn attempts every n seconds (default: off)")             { |OPTIONS[:repeat]| }
96 97
   opts.on("-e", "--environment=name", String,  "test|development|production (default: #{OPTIONS[:environment]})")  { |OPTIONS[:environment]| }
  98
+  opts.on("-n", "--process=name",     String,  "default: #{OPTIONS[:process]})")                                   { |OPTIONS[:process]| }
97 99
   opts.on("-s", "--spawner=path",     String,  "default: #{OPTIONS[:spawner]}")                                    { |OPTIONS[:spawner]| }
98 100
   opts.on("-d", "--dispatcher=path",  String,  "default: #{OPTIONS[:dispatcher]}") { |dispatcher| OPTIONS[:dispatcher] = File.expand_path(dispatcher) }
99 101
 

0 notes on commit d1d8657

Please sign in to comment.
Something went wrong with that request. Please try again.