supervisord的一个错误pkg_resources.EntryPoint.parse(“x=”+spec).load(False)

在部署一个用Go写的二进制程序时,使用了supervisord来进行进程管理。

配置是这样写的

[program:yunjiucai]
directory=/www/wwwroot/yunjiucai
command=/www/wwwroot/yunjiucai/yunjiucai
autostart=true
user=www
redirect_stderr=true
stdout_logfile=/www/wwwroot/yunjiucai/logs

系统环境:

# CentOS 版本
[ghrn109@instance-4 yunjiucai]$ lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.6.1810 (Core) 
Release:        7.6.1810
Codename:       Core
# supervisord 版本
[ghrn109@instance-4 yunjiucai]$ supervisord -v
3.1.4

然后启动supervisord时,竟然起不来。

查看了一下supervisord状态,结果如下:

[ghrn109@instance-4 yunjiucai]$ sudo systemctl status supervisord -l
● supervisord.service - Process Monitoring and Control Daemon
   Loaded: loaded (/usr/lib/systemd/system/supervisord.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2019-07-18 23:21:40 CST; 2min 45s ago
  Process: 23150 ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf (code=exited, status=0/SUCCESS)
 Main PID: 23153 (code=exited, status=1/FAILURE)

Jul 18 23:21:39 instance-4 systemd[1]: Starting Process Monitoring and Control Daemon...
Jul 18 23:21:39 instance-4 supervisord[23150]: /usr/lib/python2.7/site-packages/supervisor/options.py:383: PkgResourcesDeprecationWarning: Parameters to load are deprecated.  Call .resolve and .require separately.
Jul 18 23:21:39 instance-4 supervisord[23150]: return pkg_resources.EntryPoint.parse("x="+spec).load(False)
Jul 18 23:21:39 instance-4 systemd[1]: Started Process Monitoring and Control Daemon.
Jul 18 23:21:40 instance-4 systemd[1]: supervisord.service: main process exited, code=exited, status=1/FAILURE
Jul 18 23:21:40 instance-4 systemd[1]: Unit supervisord.service entered failed state.
Jul 18 23:21:40 instance-4 systemd[1]: supervisord.service failed.

根据/usr/lib/python2.7/site-packages/supervisor/options.py:383: PkgResourcesDeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately.return pkg_resources.EntryPoint.parse("x="+spec).load(False),本人猜测是stdout_logfile不正确。尝试把stdout_logfile=注释,竟然成功启动supervisord了。

搜了一下,是supervisord老版本的BUG,在3.2.0版已解决

  • Fixed DeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately. on setuptools >= 11.3.
Leave a Reply