2

supervisor错误:ERROR (spawn error)

 2 years ago
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.
neoserver,ios ssh client

一、问题描述

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

20191112100924395.png

二、问题分析

1.查看supervisor配置文件

如:/etc/supervisor/conf.d/supervisor-mysite.conf

  1. [program:mysite]
  2. command=/usr/local/bin/gunicorn --bind unix:/tmp/www.sweeneys.cn.socket mysite.wsgi:application
  3. directory=/home/Sweeneys/www/mysite
  4. user=Sweeneys
  5. autostart=true
  6. autorestart=true
  7. stopasgroup=true
  8. killasgroup=true
  9. redirect_stderr=true
  10. stdout_logfile_maxbytes=200MB
  11. stdout_logfile_backups=10
  12. 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

查看到具体错误信息:

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2Nja2F2aW4=,size_16,color_FFFFFF,t_70

三、解决方法

根据第二步可以看到是因为用户对目录没有权限导致服务无法启动,给用户授权即可。当然,这只是个例,ERROR (spawn error)也有可能是其它问题引起,需要查看具体的错误信息以及配置情况。

四、参考资料

[1]supervisorctl Actions:http://supervisord.org/running.html#supervisorctl-actions


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK