summaryrefslogtreecommitdiff
path: root/bin/tapicero
diff options
context:
space:
mode:
Diffstat (limited to 'bin/tapicero')
-rwxr-xr-xbin/tapicero13
1 files changed, 6 insertions, 7 deletions
diff --git a/bin/tapicero b/bin/tapicero
index c20a114..72f974b 100755
--- a/bin/tapicero
+++ b/bin/tapicero
@@ -1,10 +1,10 @@
-#!/usr/bin/ruby
+#!/usr/bin/env ruby
-require 'pathname'
#
# Tapicero Daemon
#
+require 'pathname'
BASE_DIR = Pathname.new(__FILE__).realpath + '../..'
begin
@@ -46,7 +46,8 @@ end
# --overwrite-security overwrite existing couch security settings
# TODO: not implemented yet:
# --overwrite-designs overwrite existing design documents
-Tapicero::FLAGS.concat ARGV.grep(/--.*/)
+Tapicero::FLAGS.concat ARGV.grep(/--.*/)
+Tapicero::CONFIGS.concat ARGV.grep(/\.ya?ml$/)
# if flags have been set but an action is missing we assume
# tapicero should run in foreground.
@@ -59,7 +60,6 @@ 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
@@ -70,7 +70,6 @@ begin
Daemons.run("#{BASE_DIR}/lib/tapicero_daemon.rb", options)
rescue SystemExit
rescue Exception => exc
- Tapicero.logger.error "Uncaught exception. Daemon will die."
- Tapicero.logger.error exc.class.name + ": " + exc.to_s
- Tapicero.logger.error exc.backtrace.join("\n")
+ puts exc.class.name + exc.to_s
+ puts exc.backtrace.join("\n")
end