折腾:
【已解决】CentOS中如何用systemctl管理supervisor包括设置supervisor开机启动
期间,用systemctl去启动supervisor结果出错:
<code>[root@xx-general-01 system]# systemctl daemon-reload [root@xx-general-01 system]# systemctl start supervisord Job for supervisord.service failed because the control process exited with error code. See "systemctl status supervisord.service" and "journalctl -xe" for details. [root@xx-general-01 system]# systemctl status supervisord.service ● supervisord.service - supervisord - Supervisor process control system for UNIX Loaded: loaded (/usr/lib/systemd/system/supervisord.service; enabled; vendor preset: disabled) Active: activating (auto-restart) (Result: exit-code) since Thu 2018-05-24 15:55:04 CST; 9s ago Docs: http://supervisord.org Process: 24078 ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf (code=exited, status=2) Main PID: 678 (code=exited, status=2) May 24 15:55:04 xx-general-01 systemd[1]: Failed to start supervisord - Supervisor process control system for UNIX. May 24 15:55:04 xx-general-01 systemd[1]: Unit supervisord.service entered failed state. May 24 15:55:04 xx-general-01 systemd[1]: supervisord.service failed. </code>
想要去看看配置文件,发现不存在,是旧rpmsaved
<code>[root@xx-general-01 system]# cat /etc/supervisord.conf.rpmsave ; Sample supervisor config file. [unix_http_server] ... </code>
所以重新命名:
<code>[root@xx-general-01 system]# mv /etc/supervisord.conf.rpmsave /etc/supervisord. supervisord.conf.rpmsave supervisord.d/ [root@xx-general-01 system]# mv /etc/supervisord.conf.rpmsave /etc/supervisord.conf </code>
再去运行,还是出错:
<code>[root@xx-general-01 system]# systemctl start supervisord Job for supervisord.service failed because the control process exited with error code. See "systemctl status supervisord.service" and "journalctl -xe" for details. [root@xx-general-01 system]# systemctl status supervisord.service ● supervisord.service - supervisord - Supervisor process control system for UNIX Loaded: loaded (/usr/lib/systemd/system/supervisord.service; enabled; vendor preset: disabled) Active: activating (auto-restart) (Result: exit-code) since Thu 2018-05-24 15:56:29 CST; 6s ago Docs: http://supervisord.org Process: 24091 ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf (code=exited, status=2) Main PID: 678 (code=exited, status=2) May 24 15:56:29 xx-general-01 systemd[1]: supervisord.service: control process exited, code=exited status=2 May 24 15:56:29 xx-general-01 systemd[1]: Failed to start supervisord - Supervisor process control system for UNIX. May 24 15:56:29 xx-general-01 systemd[1]: Unit supervisord.service entered failed state. May 24 15:56:29 xx-general-01 systemd[1]: supervisord.service failed. </code>
去找找原因:
【未解决】supervisor的conf配置中无法使用自定义变量或环境变量
【总结】
对于systemctl运行supervisor出错,显示:
Job for supervisord.service failed because the control process exited with error code
先去查状态
<code>systemctl status supervisord.service </code>
从而可以看出基本的错误:
此处是conf文件不存在,所以从另外一个现存conf,mv重命名后,即可解决此处问题。
如果还是看不出问题,那么去:
<code>journalctl -xe </code>
则可以看出具体的错误。
然后根据错误,找到原因,去解决即可。
只不过,此处是遇到一个,目前无法实现的需求,所以无法解决:
【未解决】supervisor的conf配置中无法使用自定义变量或环境变量
转载请注明:在路上 » 【已解决】supervisor启动出错:Job for supervisord.service failed because the control process exited with error code