bin/rflow in rflow-1.1.0 vs bin/rflow in rflow-1.2.0

- old
+ new

@@ -2,10 +2,15 @@ # Will require rflow after option parsing to speed up a couple of # startup cases (version and help) that don't need it require 'optparse' +if Process::Sys.geteuid == 0 + STDERR.puts "Error: RFlow will not run as root." + exit 1 +end + options = { :daemonize => true, :startup_log_level => :INFO, :extensions_file_paths => [], :gems => [] @@ -184,20 +189,25 @@ # load all the file extensions options[:extensions_file_paths].each do |extensions_file_path| RFlow.logger.info "Loading #{extensions_file_path}" unless File.readable? extensions_file_path - RFlow.logger.fatal "Extensions file ('#{Dir.getwd}') '#{extensions_file_path}' not reabable\n#{option_parser.help}" + RFlow.logger.fatal "Extensions file ('#{Dir.getwd}') '#{extensions_file_path}' not readable\n#{option_parser.help}" exit 1 end - load extensions_file_path + begin + load extensions_file_path + rescue Exception => e + RFlow.logger.fatal "Error running rflow: #{e.class}: #{e.message}, because: #{e.backtrace}" + exit 1 + end end # Start the flow begin RFlow.run! options[:config_database_path], options[:daemonize] rescue Exception => e - RFlow.logger.fatal "Error running rflow: #{e.class}: #{e.message}" + RFlow.logger.fatal "Error running rflow: #{e.class}: #{e.message}, because: #{e.backtrace}" exit(1) end __END__