bin/pushyd in pushyd-0.26.2 vs bin/pushyd in pushyd-0.27.0
- old
+ new
@@ -16,10 +16,11 @@
begin
# Defaults
cmd_config = nil
cmd_logfile = nil
cmd_dump = nil
+ cmd_daemonize = nil
# Init Chamber-based configuration from Gemspec
Conf.init File.dirname(__FILE__) + "/../"
Conf.app_env = "production"
@@ -27,10 +28,12 @@
parser = OptionParser.new do |opts|
opts.banner = "Usage: #{File.basename $PROGRAM_NAME} [options] run|start|stop"
opts.on("-l", "--log LOGFILE") { |path| cmd_logfile = File.expand_path(path.to_s)}
opts.on("-c", "--config CONFIGFILE") { |path| cmd_config = File.expand_path(path.to_s)}
opts.on("-e", "--environment ENV") { |env| Conf.app_env = env }
+ opts.on("-d", "--daemonize", "Run daemonized in the background"){ cmd_daemonize = true }
+ opts.on("-f", "--foreground", "Run in the foreground") { cmd_daemonize = false }
opts.on("", "--dev") { Conf.app_env = "development" }
opts.on("", "--dump", "Dump config as seen by the process") { |value| cmd_dump = true }
end
parser.order!(ARGV)
@@ -53,10 +56,11 @@
# Display final configuration, quit if config dump requested
puts "--- #{Conf.app_name} #{Conf.app_ver}"
puts "Environment \t #{Conf.app_env}"
puts "Config files \t #{Conf.files}"
puts "Started at \t #{Conf.app_started}"
+puts "Daemonize \t #{cmd_daemonize}"
puts "Loging to file \t #{Conf[:log][:file]}" if Conf[:log].is_a? Enumerable
puts "Process name \t #{Conf.generate_process_name}"
puts "Newrelic \t #{Conf.feature_newrelic? || '-'}"
puts "Rollbar \t #{Conf.feature_rollbar? || '-'}"
if cmd_dump
@@ -64,11 +68,11 @@
puts Conf.dump
end
# Run daemon
run_options = {
-monitor: false,
- ontop: false,
+ monitor: false,
+ ontop: !cmd_daemonize,
backtrace: true,
multiple: false,
dir_mode: :normal,
dir: '/tmp/'
}