Sha256: 15fe63ac5864748cbf21eacfb2685eea0fecfff7e4c584d18695ee64df5c170a

Contents?: true

Size: 1.14 KB

Versions: 12

Compression:

Stored size: 1.14 KB

Contents

#!/usr/bin/ruby
require 'yaml'
opts = YAML::load_file(File.join(__dir__,'opts.yaml'))
opts[:pidf] = __FILE__ + '.pid'
opts[:pid] = Process.pid

global_controller = File.join(opts[:global_executionhandlers],opts[:executionhandler],'controller.rb')
controller        = File.join(opts[:executionhandlers],       opts[:executionhandler],'controller.rb')
if File.exist? global_controller
  require global_controller
elsif File.exist? controller
  require controller
end

global_connectionhandler = File.join(opts[:global_executionhandlers],opts[:executionhandler],'connection.rb')
connectionhandler        = File.join(opts[:executionhandlers],       opts[:executionhandler],'connection.rb')
if File.exist? global_connectionhandler
  require global_connectionhandler
elsif File.exist? connectionhandler
  require connectionhandler
end

require_relative 'instance'
controller = Controller.new(File.basename(__dir__).to_i, __dir__, opts)
controller.instance = Instance.new controller

File.write(opts[:pidf],opts[:pid])

%w{TERM HUP INT}.each do |sig|
  Signal.trap(sig) do
    puts "Caught #{sig}!"
    controller.stop
  end
end

controller.start
File.unlink(opts[:pidf])

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cpee-2.1.58 server/executionhandlers/ruby/backend/run
cpee-2.1.57 server/executionhandlers/ruby/backend/run
cpee-2.1.56 server/executionhandlers/ruby/backend/run
cpee-2.1.55 server/executionhandlers/ruby/backend/run
cpee-2.1.54 server/executionhandlers/ruby/backend/run
cpee-2.1.53 server/executionhandlers/ruby/backend/run
cpee-2.1.52 server/executionhandlers/ruby/backend/run
cpee-2.1.51 server/executionhandlers/ruby/backend/run
cpee-2.1.50 server/executionhandlers/ruby/backend/run
cpee-2.1.49 server/executionhandlers/ruby/backend/run
cpee-2.1.48 server/executionhandlers/ruby/backend/run
cpee-2.1.47 server/executionhandlers/ruby/backend/run