supervisor安装及配置守护workerman进程

1、安装

yum install supervisor

2、一旦supervisor安装完成,运行echo_supervisord_conf。打印一个“示例”管理器配置文件到终端的标准输出。

echo_supervisord_conf

3、看到文件回显到终端后,重新调用命令echo_supervisord_conf > /etc/supervisord.conf。如果您没有root权限,这将不起作用。

echo_supervisord_conf>/etc/supervisord.conf

4、取消/etc/supervisord.conf文件最后两行得注释

[include]files=/etc/supervisord.d/*.ini

5、在创建配置文件workerman.ini

[program:workerman-start]

process_name=%(program_name)s_%(process_num)01d

command=php/data/wwwroot/GatewayWorker/start.php start -d

autostart=true

autorestart=true

user=root

numprocs=1

redirect_stderr=true

stdout_logfile=/data/wwwlogs/workermanstart.log

6、重载supervisord配置

sudo supervisorctl reread

sudo supervisorctl update

sudo supervisorctl start workerman-start:*

运行sudo supervisorctl reread,如果报错error:class 'socket.error' [Errno 2] No such file or directory: file: /usr/lib64/python2.7/socke,解决方案:

/usr/bin/python2 /usr/bin/supervisord -c /etc/supervisord.conf


链接:https://www.jianshu.com/p/3288c44105be

你可能感兴趣的:(supervisor安装及配置守护workerman进程)