执行命令 supervisord -c /etc/supervisord.conf 时,报错:
Error: File contains no section headers.
file: '/etc/supervisor/conf.d/imgweb.conf', line: 1
';/etc/supervisor/conf.d/imgweb.conf\n'
For help, use /home/ejior/.virtualenvs/begin/bin/supervisord -h
再执行命令 supervisorctl status 时,报如下错误:
unix:///tmp/supervisor.sock no such file
原因是配置文件 /etc/supervisor/conf.d/imgweb.conf 的首行,我加了一行注释,如下所示。
;/etc/supervisor/conf.d/imgweb.conf
[program:imgweb]
command=/home/ejior/.virtualenvs/begin/bin/gunicorn -w 4 -b 0.0.0.0:8001 imgweb:app
directory=/home/ejior/Documents/flask/demo2
startsecs=0
stopwaitsecs=0
autostart=false
autorestart=true
stdout_logfile=/home/ejior/Documents/flask/demo2/logs/gunicorn.log
stderr_logfile=/home/ejior/Documents/flask/demo2/logs/gunicorn.err
删除改行就行了。