CentOS 7.4 配置 Supervisor 守护进程
Posted 亦非我所愿丶
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS 7.4 配置 Supervisor 守护进程相关的知识,希望对你有一定的参考价值。
1、安装
yum install python-setuptools
easy_install supervisor
2、创建守护进程跟路径
mkdir -m 700 -p /etc/supervisor
3、在目录“ /etc/supervisor”下创建配置文件
echo_supervisord_conf > /etc/supervisor/supervisord.conf
4、修改配置
vim /etc/supervisor/supervisord.conf
在文件末尾添加
[include]
files=/etc/supervisor/conf.d/*.conf
5、创建配置存放路径
mkdir -m 700 /etc/supervisor/conf.d
6、创建进程配置文件,示例:LandingQueueProcess.conf的守护进程,关键配置:
touch /etc/supervisor/conf.d/LandingQueueProcess.conf
[program:LandingQueueProcess]
command = /usr/local/php-7.1.13/bin/php artisan queue:work
directory = /usr/local/www/product-chuiyi-site-landing
autorestart = true
autostart = true
startretries = 2
numprocs = 1
stderr_logfile = /tmp/LandingQueueProcess.log
stdout_logfile = /tmp/LandingQueueProcess.log
user = tracker
stopsignal = KILL
stopsignal = INT
7、启动supervisor
supervisord -c /etc/supervisor/supervisord.conf
ps:如果服务已启动,修改配置文件可用“ supervisorctl reload ”命令来使其生效
以上是关于CentOS 7.4 配置 Supervisor 守护进程的主要内容,如果未能解决你的问题,请参考以下文章