# File lib/fluent/supervisor.rb, line 81 def self.default_options { :config_path => Fluent::DEFAULT_CONFIG_PATH, :plugin_dirs => [Fluent::DEFAULT_PLUGIN_DIR], :log_level => Fluent::Log::LEVEL_INFO, :log_path => nil, :daemonize => nil, :libs => [], :setup_path => nil, :chuser => nil, :chgroup => nil, :suppress_interval => 0, :suppress_repeated_stacktrace => true, :without_source => false, :use_v1_config => true, :supervise => true, } end
# File lib/fluent/supervisor.rb, line 30 def self.get_etc_group(group) if group.to_i.to_s == group Etc.getgrgid(group.to_i) else Etc.getgrnam(group) end end
# File lib/fluent/supervisor.rb, line 22 def self.get_etc_passwd(user) if user.to_i.to_s == user Etc.getpwuid(user.to_i) else Etc.getpwnam(user) end end
# File lib/fluent/supervisor.rb, line 100 def initialize(opt) @daemonize = opt[:daemonize] @supervise = opt[:supervise] @config_path = opt[:config_path] @inline_config = opt[:inline_config] @use_v1_config = opt[:use_v1_config] @log_path = opt[:log_path] @dry_run = opt[:dry_run] @libs = opt[:libs] @plugin_dirs = opt[:plugin_dirs] @chgroup = opt[:chgroup] @chuser = opt[:chuser] @log_level = opt[:log_level] @suppress_interval = opt[:suppress_interval] @suppress_config_dump = opt[:suppress_config_dump] @without_source = opt[:without_source] log_opts = {:suppress_repeated_stacktrace => opt[:suppress_repeated_stacktrace]} @log = LoggerInitializer.new(@log_path, @log_level, @chuser, @chgroup, log_opts) @finished = false @main_pid = nil end
# File lib/fluent/supervisor.rb, line 159 def options { 'config_path' => @config_path, 'pid_file' => @daemonize, 'plugin_dirs' => @plugin_dirs, 'log_path' => @log_path } end
# File lib/fluent/supervisor.rb, line 124 def start @log.init read_config apply_system_config dry_run if @dry_run start_daemonize if @daemonize if @supervise install_supervisor_signal_handlers until @finished supervise do change_privilege init_engine install_main_process_signal_handlers run_configure finish_daemonize if @daemonize run_engine exit 0 end $log.error "fluentd main process died unexpectedly. restarting." unless @finished end else $log.info "starting fluentd-#{Fluent::VERSION} without supervision" main_process do change_privilege init_engine install_main_process_signal_handlers run_configure finish_daemonize if @daemonize run_engine exit 0 end end end
Generated with the Darkfish Rdoc Generator 2.