Open okkez opened 6 years ago
Maybe we need ExecStartPre
to upgrade td-agent version.
I'm testing following command:
ExecStartPre=-/bin/sh -c "/opt/td-agent/embedded/bin/bundle check --gemfile=/etc/td-agent/Gemfile || /opt/td-agent/embedded/bin/bundle install --gemfile=/etc/td-agent/Gemfile --path=/var/lib/td-agent/vendor/bundle || /usr/bin/env BUNDLE_GEMFILE=/etc/td-agent/Gemfile /opt/td-agent/embedded/bin/bundle update"
NOTE: Bundler 1.17.1 supports bundle update --gemfile=...
, but 1.16.2 does not support it.
Doesn't seem to work yet.
Continuation of #166.
What is problem
We can see following permissions after td-agent3 installation:
Bundler 1.16.0 checks permissions around
--gemfile
and--gem-path
. For example, we have /etc/td-agent/Gemfile and /etc/td-agent/vendor/bundle does not exist. Bundler checks permission like this.td-agent will fail to start process with td-agent.service like https://github.com/treasure-data/omnibus-td-agent/issues/166#issue-300500350, because /etc/td-agent/td-agent.conf and /etc/td-agnet/plugins are not writable by td-agent user.
So, we should consider
--gemfile
and--gem-path
options.About drop-in file
We can use systemd drop-in file instead of overwriting td-agent.service by /etc/systemd/system/td-agent.tservice like https://github.com/treasure-data/omnibus-td-agent/issues/166#issue-300500350.
and creating following /etc/systemd/system/td-agent.service.d/override.conf:
Proposal
Adding documents about Gemfile based plugin management to fluentd-docs repository.
Use following drop-in file
/etc/systemd/system/td-agent.service.d/override.conf
for td-agent 3.1.1 :For next version of td-agent:
And add Gemfile example:
See: https://qiita.com/toyama0919/items/c4d319bf819c01e5d73e (Japanese article)
However we must download gem packages when we use Gemfile based plugin management even if we use td-agent bundled gems only. This is a disadvantage of Gemfile based plugin management.