diff options
author | Azul <azul@riseup.net> | 2014-01-03 10:07:51 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2014-01-03 10:07:51 +0100 |
commit | 32409f06920cfa2eb9e23deb74c3e09db677fe77 (patch) | |
tree | 879303205dd2c9c7c103377f647efd1abb215d48 /bin/tapicero | |
parent | 331f33ec969e1fb3d893267231dfe5fc3e2701ca (diff) |
ensure we log all errors
Diffstat (limited to 'bin/tapicero')
-rwxr-xr-x | bin/tapicero | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/tapicero b/bin/tapicero index ddd71c6..1c23947 100755 --- a/bin/tapicero +++ b/bin/tapicero @@ -55,13 +55,21 @@ if ARGV.first.start_with?('--') ARGV.unshift 'run' end + # # Start the daemon # +require 'tapicero' # so we can use Tapicero.logger below. require 'daemons' if ENV["USER"] == "root" options = {:app_name => 'tapicero', :dir_mode => :system} # this will put the pid file in /var/run else options = {:app_name => 'tapicero', :dir_mode => :normal, :dir => '/tmp'} # this will put the pid file in /tmp end -Daemons.run("#{BASE_DIR}/lib/tapicero_daemon.rb", options) +begin + Daemons.run("#{BASE_DIR}/lib/tapicero_daemon.rb", options) +rescue Exception => exc + Tapicero.logger.error "TAPICERO DYING XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + Tapicero.logger.error exc.to_s + Tapicero.logger.error exc.backtrace +end |