summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2014-04-14 16:28:23 +0300
committerSaku Ytti <saku@ytti.fi>2014-04-14 16:28:23 +0300
commit57a8f4bc04b4f87ad0d7028dcbf29b96d49eaffd (patch)
tree82567c791b0114e62fa3b978eb2bb95733d6488b /bin
parent1a1794b2b3ac99764852546c550fd7988f84c37b (diff)
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
Diffstat (limited to 'bin')
-rwxr-xr-xbin/oxidized21
1 files changed, 7 insertions, 14 deletions
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