supervisor环境变量

2019-08-08  本文已影响0人  蕴重Liu
[program:aib-humanpose]
environment=PYTHONPATH=/root/anaconda3/lib/python3.6/site-packages
command=/root/anaconda3/bin/python gateway_b_human_pose.py
directory=/ChainDevOps/lyq/AiVideoServiceEngine/src               ; directory to cwd to before exec (def no cwd)

stopsignal=INT               ; signal used to kill process (default TERM)

stdout_logfile=/data/log/supervisor/aib-humanpose.out.log   ; stderr log path, NONE for none; default AUTO
stdout_logfile_maxbytes=4GB   ; max # logfile bytes b4 rotation (default 50MB)
stdout_logfile_backups=10     ; # of stdout logfile backups (default 10)

stdout_events_enabled=true   ; emit events on stdout writes (default false)

stderr_logfile=/data/log/supervisor/aib-humanpose.err.log   ; stderr log path, NONE for none; default AUTO
stderr_logfile_maxbytes=1GB   ; max # logfile bytes b4 rotation (default 50MB)
stderr_logfile_backups=10     ; # of stderr logfile backups (default 10)

stderr_events_enabled=true   ; emit events on stderr writes (default false)

startsecs=20

验证1-py文件,脚本中执行

import sys
print(sys.path)

验证2-supervisor配置文件

[program:test_python3]
command=/usr/local/bin/python3 /home/hunter/test.py
user=hunter
environment=AIRFLOW_HOME="/home/hunter/airflow"
environment=PYTHONPATH=/root/anaconda3/lib/python3.6/site-packages

对于用户python路径(pip install XXX --user安装的位置)(~/.local),也可以通过指定HOME来让python找到模块所在的路径:
environment=HOME=/home/hunter

上一篇 下一篇

猜你喜欢

热点阅读