about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--bin/mongrel_rails4
-rw-r--r--lib/mongrel/configurator.rb6
-rw-r--r--lib/mongrel/rails.rb2
3 files changed, 7 insertions, 5 deletions
diff --git a/bin/mongrel_rails b/bin/mongrel_rails
index c32b818..5d17466 100644
--- a/bin/mongrel_rails
+++ b/bin/mongrel_rails
@@ -1,3 +1,5 @@
+#!/usr/bin/env ruby
+#
 # Copyright (c) 2005 Zed A. Shaw
 # You can redistribute it and/or modify it under the same terms as Ruby.
 #
@@ -137,7 +139,7 @@ module Mongrel
       config.join
 
       if config.needs_restart
-        if RUBY_PLATFORM !~ /mswin/
+        if RUBY_PLATFORM !~ /djgpp|(cyg|ms|bcc)win|mingw/
           cmd = "ruby #{__FILE__} start #{original_args.join(' ')}"
           config.log "Restarting with arguments:  #{cmd}"
           config.stop(false, true)
diff --git a/lib/mongrel/configurator.rb b/lib/mongrel/configurator.rb
index bbb88ba..439b44c 100644
--- a/lib/mongrel/configurator.rb
+++ b/lib/mongrel/configurator.rb
@@ -81,7 +81,7 @@ module Mongrel
 
     # Writes the PID file if we're not on Windows.
     def write_pid_file
-      if RUBY_PLATFORM !~ /mswin/
+      if RUBY_PLATFORM !~ /djgpp|(cyg|ms|bcc)win|mingw/
         log "Writing PID file to #{@pid_file}"
         open(@pid_file,"w") {|f| f.write(Process.pid) }
         open(@pid_file,"w") do |f|
@@ -185,7 +185,7 @@ module Mongrel
     def daemonize(options={})
       ops = resolve_defaults(options)
       # save this for later since daemonize will hose it
-      if RUBY_PLATFORM !~ /mswin/
+      if RUBY_PLATFORM !~ /djgpp|(cyg|ms|bcc)win|mingw/
         require 'daemons/daemonize'
 
         logfile = ops[:log_file]
@@ -366,7 +366,7 @@ module Mongrel
       # clean up the pid file always
       at_exit { remove_pid_file }
 
-      if RUBY_PLATFORM !~ /mswin/
+      if RUBY_PLATFORM !~ /djgpp|(cyg|ms|bcc)win|mingw/
         # graceful shutdown
         trap("TERM") { log "TERM signal received."; stop }
         trap("USR1") { log "USR1 received, toggling $mongrel_debug_client to #{!$mongrel_debug_client}"; $mongrel_debug_client = !$mongrel_debug_client }
diff --git a/lib/mongrel/rails.rb b/lib/mongrel/rails.rb
index 853ae4e..7f66a5e 100644
--- a/lib/mongrel/rails.rb
+++ b/lib/mongrel/rails.rb
@@ -173,7 +173,7 @@ module Mongrel
         ops = resolve_defaults(options)
         setup_signals(options)
 
-        if RUBY_PLATFORM !~ /mswin/
+        if RUBY_PLATFORM !~ /djgpp|(cyg|ms|bcc)win|mingw/
           # rails reload
           trap("HUP") { log "HUP signal received."; reload!          }