about summary refs log tree commit homepage
path: root/bin/mongrel_rails
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mongrel_rails')
-rw-r--r--bin/mongrel_rails10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/mongrel_rails b/bin/mongrel_rails
index e5b5248..d96dc5d 100644
--- a/bin/mongrel_rails
+++ b/bin/mongrel_rails
@@ -139,7 +139,15 @@ module Mongrel
         if RUBY_PLATFORM !~ /mswin/
           cmd = "ruby #{__FILE__} start #{original_args.join(' ')}"
           config.log "Restarting with arguments:  #{cmd}"
-          exec cmd
+          config.stop
+          config.remove_pid_file
+
+          if config.defaults[:daemon]
+            system cmd
+          else
+            STDERR.puts "Can't restart unless in daemon mode."
+            exit 1
+          end
         else
           config.log "Win32 does not support restarts. Exiting."
         end