summaryrefslogtreecommitdiff
path: root/bin/oxidized
blob: 72db61aeebbae1c4248c5b3b8e4b9ed375e572cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env ruby

require 'oxidized'

trap("INT") { exit } # sinatra will otherwise steak this from us

begin
  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}"
end