diff --git a/app/models/plugin.rb b/app/models/plugin.rb index 9da967c..97b6a3d 100644 --- a/app/models/plugin.rb +++ b/app/models/plugin.rb @@ -190,11 +190,15 @@ class Plugin end def fluent_gem_path + if Fluentd.instance.fluentd? + return "fluent-gem" # maybe `fluent-gem` command is in the $PATH + end + + # NOTE: td-agent has a command under the /usr/lib{,64}, td-agent2 has under /opt/td-agent %W( - fluent-gem + /opt/td-agent/embedded/bin/fluent-gem /usr/lib/fluent/ruby/bin/fluent-gem /usr/lib64/fluent/ruby/bin/fluent-gem - /opt/td-agent/embedded/bin/fluent-gem ).find do |path| system("which #{path}", out: File::NULL, err: File::NULL) end