From b9e4bd7af8e7dac84e6bf6fe49fedc65229e24d4 Mon Sep 17 00:00:00 2001 From: uu59 Date: Thu, 17 Jul 2014 13:51:02 +0900 Subject: [PATCH] Strict detetction fluent-gem command with setup fluentd/td-agent specific --- app/models/plugin.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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