supervisor配置

cooolr 于 2022-04-26 发布

设置环境变量

[program:django]
environment=SITE=domain1
command = python manage.py command

指定用户执行

[program:spider_scrapyd]
command=/home/bigdata/.conda/envs/spiders/bin/scrapyd
environment=HOME="/home/bigdata",USER="bigdata"
[program:testpro]
command=sudo -u bob -i python /path/to/myfile.py

设置执行目录

[program:spider_scrapyd]
command=/home/bigdata/.conda/envs/spiders/bin/scrapyd
directory=/home/spider/code/scrapyd

指定日志

autostart=false
startsecs=3
redirect_stderr=true
stdout_logfile_maxbytes=20MB
stdout_logfile_backups = 20
stdout_logfile=/data/log/bert-base-serving.std
stderr_logfile=/data/log/bert-base-serving.err