supervisorctl status 查看进程运行状态
supervisorctl start 进程名 启动进程
supervisorctl stop 进程名 关闭进程
supervisorctl restart 进程名 重启进程
supervisorctl update 重新载入配置文件
supervisorctl shutdown 关闭supervisord
supervisorctl reload 重启配置中的所有进程
centos7 Supervisor的配置文件在
/etc/supervisord.conf
底部有声明加载指定目录的每个项目的配置文件
[include]
files = /etc/supervisord.d/conf.d/*.ini
配置例子,这个是跑laravel队列的一个任务
demo.ini
[program:demo]
process_name=%(program_name)s_%(process_num)02d
command=php /home/wwwroot/demo/artisan queue:work database --sleep=3 --tries=1 --timeout=180 --queue=notify,default
autostart=true
autorestart=true
user=www
numprocs=1
redirect_stderr=true
stdout_logfile=/home/wwwroot/demo/worker.log
web界面,把主配置文件中开启
[inet_http_server] ; inet (TCP) server disabled by default
port=0.0.0.0:9001 ; (ip_address:port specifier, *:port for all iface)
username=user ; (default is no username (open server))
password=123 ; (default is no password (open server))