LoginSignup
2
2

More than 5 years have passed since last update.

aws elastic beanstalkでtd-agentをインストールする場合

Posted at

.ebextensions/配下に01_xxx.configでtd-agentをインストールを指示するファイルを用意する

commands:
  01_install-td-agent:
    command: |
      rpm -q td-agent || curl -L http://toolbelt.treasuredata.com/sh/install-redhat-td-agent2.sh | sh

これで実行するとsudo: sorry, you must have a tty to run sudoといった感じのエラーが出る場合がある。
これを解消するには、http://toolbelt.treasuredata.com/sh/install-redhat-td-agent2.shからsudoを排除するか、sudoersの設定を変更する必要がある。
後者の方が簡単だったのでそれを実施するようにした。
/etc/sudoers.d/配下にroot時はttyを無視するようにするというファイルを置くように、上の01_xxx.configに追記する

files:
  "/etc/sudoers.d/root-ignore-tty":
    mode: "000644"
    owner: "root"
    group: "root"
    content: |
      Defaults:root !requiretty

これでeb deployするとtd-agentがインストールされる。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2