LoginSignup
1
1

More than 5 years have passed since last update.

AWS EC2でyum installしたSupervisorで環境変数を使う方法

Last updated at Posted at 2017-04-30

yum install をしてsupervisorをインストールするとsupervisor2.1がインストールされてしまうらしい。(supervisor2.1だとversionの確認が出来ないので、2.1かどうかはyum info supervisorで確認できる)

supervisor3からenvironment句が使用できるようになってはいるが、上記でインストールされてしまう場合はenvironment句が使用できないので、環境変数を指定したデーモン監視が出来ない。
また、環境変数を指定してコマンドを実行する下記のようなやり方も、supervisor側の問題で実行出来ない模様

HOGE=fuga command run

解決方法

使用可能なコマンドからcommand句が開始していればいいので、bash -c "<command>"形式で解決。

supervisord.conf
# 例)
command=bash -c "HOGE=fuga command run"
1
1
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
1
1