python脚本在终端中运行,但是在有监督者

时间:2018-09-09 09:11:43

标签: python sqlite beautifulsoup virtualenv supervisord

我有一个Python脚本,该脚本使用schedbeautifulsoupsqlite3定期抓取某些站点,然后将结果放回sqlite db文件中,以供其他用户进一步使用应用。
当我从终端运行脚本时,一切正常,但是当我从supervisor运行脚本时,它什么也没做。似乎进程被锁定了。我检查了日志文件,但是当我使用print方法向输出中写入一些数据时,它们也为空。
supervisor配置文件:

[program:script]
command=/home/user/code/venv/bin/python /home/user/code/db/script.py
directory=/home/user/code
user=user
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
stderr_logfile=/var/log/code/script.err.log
stderr_logfile_maxbytes=10MB
stdout_logfile=/var/log/code/script.out.log
stdout_logfile_maxbytes=10MB

0 个答案:

没有答案
相关问题