diff options
Diffstat (limited to 'script/runner')
-rwxr-xr-x | script/runner | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/script/runner b/script/runner index 2bd5e9aa7..02735531a 100755 --- a/script/runner +++ b/script/runner @@ -6,7 +6,6 @@ script_dir = File.dirname(__FILE__) alaveteli_dir = File.expand_path(File.join(script_dir, "..")) Dir.chdir(alaveteli_dir) do - require File.join(alaveteli_dir, 'config', 'boot') if daemon_mode # Run in daemon mode. @@ -20,21 +19,22 @@ Dir.chdir(alaveteli_dir) do # Load the runner in a subprocess pid = fork do - require 'commands/runner' + exec("bundle exec rails runner #{ARGV[1]}") exit 0 end # If the environment variable PIDFILE is present, # write the pid of the daemon process to that file. + if ENV.has_key? "PIDFILE" File.open(ENV["PIDFILE"], 'w') do |fh| fh.puts pid end end - + Process.detach(pid) else # Not daemon mode - require 'commands/runner' + exec("bundle exec rails runner #{ARGV[0]}") end end |