一、问题描述
使用supervisorctl启动网站的时候提示错误:ERROR (spawn error),如下图所示:

二、问题分析
1.查看supervisor配置文件
如:/etc/supervisor/conf.d/supervisor-mysite.conf
[program:mysite]
command=/usr/local/bin/gunicorn --bind unix:/tmp/www.sweeneys.cn.socket mysite.wsgi:application
directory=/home/Sweeneys/www/mysite
user=Sweeneys
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
redirect_stderr=true
stdout_logfile_maxbytes=200MB
stdout_logfile_backups=10
stdout_logfile =/var/log/supervisor/mysite-supervisor.log
然后可以看到program的名字是:mysite
2.使用supervisorctl tail program_name stderr命令查看错误信息
从配置文件supervisor-mysite.conf中可以看到program的名字是mysite,即program_name, 然后使用命令:
sudo supervisorctl tail mysite stderr
查看到具体错误信息:

三、解决方法
根据第二步可以看到是因为用户对目录没有权限导致服务无法启动,给用户授权即可。当然,这只是个例,ERROR (spawn error)也有可能是其它问题引起,需要查看具体的错误信息以及配置情况。
四、参考资料
[1]supervisorctl Actions:http://supervisord.org/running.html#supervisorctl-actions
当使用supervisor启动网站时遇到ERROR (spawn error)。问题分析包括检查配置文件,如/supervisor-mysite.conf,并使用supervisorctl tail命令查看stderr错误信息。解决方案通常涉及处理权限问题,确保用户对目录有适当权限。

1万+

被折叠的 条评论
为什么被折叠?



