CentOS 7.4 配置 Supervisor 守护进程

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wanglei_storage/article/details/83585743

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 ”命令来使其生效

猜你喜欢

转载自blog.csdn.net/wanglei_storage/article/details/83585743