about summary refs log tree commit homepage
path: root/bin
diff options
context:
space:
mode:
authorzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-03-12 07:30:25 +0000
committerzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-03-12 07:30:25 +0000
commitd4749060f42f2ccaf9ca6ab0f2975cc22dcfb523 (patch)
tree1407f774268280284a12d9f8724947d81f303a64 /bin
parent375bf06a8417b8039b2448193412ea14ba386313 (diff)
downloadunicorn-d4749060f42f2ccaf9ca6ab0f2975cc22dcfb523.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@100 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'bin')
-rw-r--r--bin/mongrel_rails8
1 files changed, 3 insertions, 5 deletions
diff --git a/bin/mongrel_rails b/bin/mongrel_rails
index eb04b86..0b48b1f 100644
--- a/bin/mongrel_rails
+++ b/bin/mongrel_rails
@@ -72,7 +72,7 @@ class Start < GemPlugin::Plugin "/commands"
 
   def configure_rails
     # need this later for safe reloading
-    @orig_dollar_quote = $".clone
+    $orig_dollar_quote = $".clone
 
     ENV['RAILS_ENV'] = @environment
     require 'config/environment'
@@ -97,6 +97,7 @@ class Start < GemPlugin::Plugin "/commands"
       # graceful shutdown
       trap("TERM") {
         server.stop
+        File.unlink @pid_file if File.exist?(@pid_file)
       }
 
       # rails reload
@@ -109,6 +110,7 @@ class Start < GemPlugin::Plugin "/commands"
       # restart
       trap("USR2") {
         server.stop
+        File.unlink @pid_file if File.exist?(@pid_file)
         @restart = true
       }
     end
@@ -179,8 +181,6 @@ class Stop < GemPlugin::Plugin "/commands"
     else
       send_signal("TERM", @pid_file)
     end
-
-    File.unlink(@pid_file)
   end
 end
 
@@ -214,8 +214,6 @@ class Restart < GemPlugin::Plugin "/commands"
     else
       send_signal("USR2", @pid_file)
     end
-
-    File.unlink(@pid_file)
   end
 end