Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 48 lines (38 sloc) 1.366 kb
5849e93 Commit backgroundrb to git
gnufied authored
1 #!/usr/bin/env ruby
2
17a68dc Implement changes that enables loading of workers by fork and exec
gnufied authored
3 RAILS_HOME = File.expand_path(File.join(File.dirname(__FILE__),".."))
4 BDRB_HOME = File.join(RAILS_HOME,"vendor","plugins","backgroundrb")
5 WORKER_ROOT = File.join(RAILS_HOME,"lib","workers")
6 WORKER_LOAD_ENV = File.join(RAILS_HOME,"script","load_worker_env")
5849e93 Commit backgroundrb to git
gnufied authored
7
17a68dc Implement changes that enables loading of workers by fork and exec
gnufied authored
8 ["server","server/lib","lib","lib/backgroundrb"].each { |x| $LOAD_PATH.unshift(BDRB_HOME + "/#{x}")}
5849e93 Commit backgroundrb to git
gnufied authored
9 $LOAD_PATH.unshift(WORKER_ROOT)
10
eae8d17 made the startup script more lsb compliant: added status, restart, ma…
Woody Peterson authored
11 require 'rubygems'
dbd299c @gnufied fix for loading vendir first
authored
12 require RAILS_HOME + "/config/boot"
8a29504 @gnufied fix for loading in foreground mode
authored
13 require "active_support"
eae8d17 made the startup script more lsb compliant: added status, restart, ma…
Woody Peterson authored
14 require 'bdrb_config'
8a29504 @gnufied fix for loading in foreground mode
authored
15
25f0426 @gnufied check in test cases
authored
16 BDRB_CONFIG = BackgrounDRb::Config.read_config("#{RAILS_HOME}/config/backgroundrb.yml")
d211e3e @gnufied improve start stop managment
authored
17 PID_FILE = "#{RAILS_HOME}/tmp/pids/backgroundrb_#{BDRB_CONFIG[:backgroundrb][:port]}.pid"
25f0426 @gnufied check in test cases
authored
18 SERVER_LOGGER = "#{RAILS_HOME}/log/backgroundrb_debug_#{BDRB_CONFIG[:backgroundrb][:port]}.log"
5849e93 Commit backgroundrb to git
gnufied authored
19
eae8d17 made the startup script more lsb compliant: added status, restart, ma…
Woody Peterson authored
20 require 'bdrb_start_stop'
d211e3e @gnufied improve start stop managment
authored
21 daemon = BackgrounDRb::StartStop.new
5849e93 Commit backgroundrb to git
gnufied authored
22
d211e3e @gnufied improve start stop managment
authored
23 case ARGV[0]
24 when 'start'; daemon.start
eae8d17 made the startup script more lsb compliant: added status, restart, ma…
Woody Peterson authored
25 when 'stop'; daemon.stop
26 when 'restart'; daemon.stop;daemon.start
27 when 'status'
28 if daemon.running?
29 puts "BackgrounDRb Running"
30 exit
31 else
32 puts "BackgrounDRb Not Running"
33 exit!(daemon.status)
34 end
35 else
b25737c @gnufied fix master proxy loading error
authored
36 require "logger"
37 require "packet"
38 require "optparse"
39
40 BackgrounDRb::Config.parse_cmd_options ARGV
41
42 require RAILS_HOME + "/config/environment"
43 require "bdrb_job_queue"
44 require "backgroundrb_server"
eae8d17 made the startup script more lsb compliant: added status, restart, ma…
Woody Peterson authored
45 BackgrounDRb::MasterProxy.new()
5849e93 Commit backgroundrb to git
gnufied authored
46 end
0d74b45 @gnufied make taks runnable on specific hosts
authored
47
Something went wrong with that request. Please try again.