supervisor错误:ERROR (spawn error)
source link: https://blog.p2hp.com/archives/8682
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
一、问题描述
使用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
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK