Sha256: 86554cab26414dfcf57b5863b8591b047e001b2d3ad93bb2c6f9ad2fe7a1c084
Contents?: true
Size: 1.16 KB
Versions: 23
Compression:
Stored size: 1.16 KB
Contents
#!/usr/bin/ruby require 'rbtrace' 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
23 entries across 13 versions & 1 rubygems