From bd02bea8608973c72ad85ab08bf6f62cf4a1d572 Mon Sep 17 00:00:00 2001 From: Yuta Iwama Date: Fri, 25 Oct 2019 11:20:23 +0900 Subject: [PATCH] Supervisor print gem list instead of worker0 Signed-off-by: Yuta Iwama --- lib/fluent/engine.rb | 5 ----- lib/fluent/supervisor.rb | 11 +++++++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/fluent/engine.rb b/lib/fluent/engine.rb index aa18ac7d57..b9af3e67e9 100644 --- a/lib/fluent/engine.rb +++ b/lib/fluent/engine.rb @@ -113,11 +113,6 @@ def run_configure(conf) end def configure(conf) - # plugins / configuration dumps - Gem::Specification.find_all.select{|x| x.name =~ /^fluent(d|-(plugin|mixin)-.*)$/}.each do |spec| - $log.info :worker0, "gem '#{spec.name}' version '#{spec.version}'" - end - @root_agent.configure(conf) begin diff --git a/lib/fluent/supervisor.rb b/lib/fluent/supervisor.rb index 36f26dffcf..38f20a5511 100644 --- a/lib/fluent/supervisor.rb +++ b/lib/fluent/supervisor.rb @@ -586,7 +586,7 @@ def dry_run Fluent::Engine.dry_run_mode = true change_privilege MessagePackFactory.init - init_engine + init_engine(supervisor: true) run_configure rescue Fluent::ConfigError => e $log.error "config error", file: @config_path, error: e @@ -794,7 +794,7 @@ def change_privilege ServerEngine::Privilege.change(@chuser, @chgroup) end - def init_engine + def init_engine(supervisor: false) Fluent::Engine.init(@system_config) @libs.each {|lib| @@ -807,6 +807,13 @@ def init_engine Fluent::Engine.add_plugin_dir(dir) end } + + if supervisor + # plugins / configuration dumps + Gem::Specification.find_all.select { |x| x.name =~ /^fluent(d|-(plugin|mixin)-.*)$/ }.each do |spec| + $log.info("gem '#{spec.name}' version '#{spec.version}'") + end + end end def run_configure