Sha256: 0d6c317e81d944d7db6f75efd4dfc90d4b367ba46ca3f5b823e6dd4265d88f8d
Contents?: true
Size: 1.46 KB
Versions: 6
Compression:
Stored size: 1.46 KB
Contents
# encoding: ascii-8bit # Copyright 2018 Ball Aerospace & Technologies Corp. # All Rights Reserved. # # This program is free software; you can modify and/or redistribute it # under the terms of the GNU General Public License # as published by the Free Software Foundation; version 3 with # attribution addendums as found in the LICENSE.txt ENV['RAILS_ENV'] = 'production' require File.expand_path('../../config/environment', __FILE__) require 'dart_common' require 'dart_decom_query' Cosmos.catch_fatal_exception do DartCommon.handle_argv Cosmos::Logger.level = Cosmos::Logger::INFO dart_logging = DartLogging.new('dart_decom_server') json_drb = Cosmos::JsonDRb.new json_drb.acl = Cosmos::System.acl if Cosmos::System.acl begin json_drb.method_whitelist = ['query', 'item_names', 'dart_status', 'clear_errors'] begin json_drb.start_service(Cosmos::System.listen_hosts['DART_DECOM'], Cosmos::System.ports['DART_DECOM'], DartDecomQuery.new, 1000, Cosmos::System) rescue Exception => error raise Cosmos::FatalError.new("Error starting JsonDRb on port #{Cosmos::System.ports['DART_DECOM']}.\nPerhaps another DART Decom Server is already running?\n#{error.formatted}") end ["TERM", "INT"].each {|sig| Signal.trap(sig) {exit}} Cosmos::Logger.info("Dart Decom Server Started...") sleep(1) while true rescue Interrupt Cosmos::Logger.info("Dart Decom Server Closing...") json_drb.stop_service dart_logging.stop end end
Version data entries
6 entries across 6 versions & 1 rubygems