summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2014-01-03 10:07:51 +0100
committerAzul <azul@riseup.net>2014-01-03 10:07:51 +0100
commit32409f06920cfa2eb9e23deb74c3e09db677fe77 (patch)
tree879303205dd2c9c7c103377f647efd1abb215d48
parent331f33ec969e1fb3d893267231dfe5fc3e2701ca (diff)
ensure we log all errors
-rwxr-xr-xbin/tapicero10
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