about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-02-27 17:04:13 -0800
committerEric Wong <normalperson@yhbt.net>2009-03-03 11:13:06 -0800
commit4414d9bf34f162a604d2aacc765ab1ca2fc90404 (patch)
tree63e133f283803747282e8270c8fc375032164c2f
parent5a04b0054c4f0c3a5962ba31688e45e8763f1cf5 (diff)
downloadunicorn-4414d9bf34f162a604d2aacc765ab1ca2fc90404.tar.gz
It's confusing with the lowercase "-p" option which is more
common for developers to use.  PID files are only needed for
production deployments, and those should be using config files
anyways.
-rwxr-xr-xbin/unicorn4
-rw-r--r--test/exec/test_exec.rb21
2 files changed, 13 insertions, 12 deletions
diff --git a/bin/unicorn b/bin/unicorn
index c306c98..30a4dfa 100755
--- a/bin/unicorn
+++ b/bin/unicorn
@@ -66,10 +66,6 @@ opts = OptionParser.new("", 24, '  ') do |opts|
     daemonize = d ? true : false
   end
 
-  opts.on("-P", "--pid FILE", "file to store PID (default: none)") do |f|
-    options[:pid] = File.expand_path(f)
-  end
-
   # Unicorn-specific stuff
   opts.on("-l", "--listen {HOST:PORT|PATH}",
           "listen on HOST:PORT or PATH",
diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb
index 4d314a4..5806210 100644
--- a/test/exec/test_exec.rb
+++ b/test/exec/test_exec.rb
@@ -376,24 +376,30 @@ end # after_fork
   def test_reexec
     File.open("config.ru", "wb") { |fp| fp.syswrite(HI) }
     pid_file = "#{@tmpdir}/test.pid"
+    ucfg = Tempfile.new('unicorn_test_config')
+    ucfg.syswrite("pid \"#{pid_file}\"\n")
     pid = fork do
       redirect_test_io do
-        exec($unicorn_bin, "-l#{@addr}:#{@port}", "-P#{pid_file}")
+        exec($unicorn_bin, "-l#{@addr}:#{@port}", "-c#{ucfg.path}")
       end
     end
-    reexec_basic_test(pid, pid_file)
+    wait_for_file(pid_file)
+    reexec_usr2_quit_test(pid, pid_file)
   end
 
   def test_reexec_alt_config
     config_file = "#{@tmpdir}/foo.ru"
-    File.open(config_file, "wb") { |fp| fp.syswrite(HI) }
     pid_file = "#{@tmpdir}/test.pid"
-    pid = fork do
+    ucfg = Tempfile.new('unicorn_test_config')
+    ucfg.syswrite("pid \"#{pid_file}\"\n")
+    File.open(config_file, "wb") { |fp| fp.syswrite(HI) }
+    pid = xfork do
       redirect_test_io do
-        exec($unicorn_bin, "-l#{@addr}:#{@port}", "-P#{pid_file}", config_file)
+        exec($unicorn_bin, "-l#{@addr}:#{@port}", "-c#{ucfg.path}", config_file)
       end
     end
-    reexec_basic_test(pid, pid_file)
+    wait_for_file(pid_file)
+    reexec_usr2_quit_test(pid, pid_file)
   end
 
   def test_unicorn_config_file
@@ -413,8 +419,7 @@ end # after_fork
     File.open("config.ru", "wb") { |fp| fp.syswrite(HI) }
     pid = xfork do
       redirect_test_io do
-        exec($unicorn_bin, "-l#{@addr}:#{@port}",
-             "-P#{pid_file}", "-c#{ucfg.path}")
+        exec($unicorn_bin, "-l#{@addr}:#{@port}", "-c#{ucfg.path}")
       end
     end
     results = retry_hit(["http://#{@addr}:#{@port}/"])