From 57a8f4bc04b4f87ad0d7028dcbf29b96d49eaffd Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Mon, 14 Apr 2014 16:28:23 +0300 Subject: Use 'asetus' for configuration files Main benefits a) we get support for system wide configs b) we don't use symbols in config file, they're confusing to non-rubyist --- bin/oxidized | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'bin/oxidized') diff --git a/bin/oxidized b/bin/oxidized index 36ab250..f2fb9ff 100755 --- a/bin/oxidized +++ b/bin/oxidized @@ -1,19 +1,12 @@ #!/usr/bin/env ruby -trap("INT") { exit } # sinatra will otherwise steak this from us +# FIX ME, killing oxidized needs -9 +trap("INT") { exit } # sinatra will otherwise steal this from us begin - require 'oxidized' - Process.daemon unless $DEBUG - Oxidized.new -rescue => e - open Oxidized::Config::Crash, 'w' do |file| - file.puts '-' * 50 - file.puts Time.now.utc - file.puts e.message + ' [' + e.class.to_s + ']' - file.puts '-' * 50 - file.puts e.backtrace - file.puts '-' * 50 - end - warn "ERROR: #{e}" + require 'oxidized/cli' + Oxidized::CLI.new.run +rescue => error + warn "#{error}" + raise if Oxidized::CFG.debug end -- cgit v1.2.1