From 32409f06920cfa2eb9e23deb74c3e09db677fe77 Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 3 Jan 2014 10:07:51 +0100 Subject: ensure we log all errors --- bin/tapicero | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3