安装:
apt-get install supervisor
配置:
默认加载 /etc/supervisor/conf.d/ 目录下的所有.conf配置文件。
[supervisord] nodaemon=true # program:后面是任务名称 [program:GameAsync] startsecs=10 redirect_stderr=true directory=/data/wwwroot/nutspoker/ command=/usr/local/php/bin/php cli.php Game async
保存为app.conf并退出, 重启supervisor服务
管理任务
# 查看帮助 supervisorctl -h # 开启GameAsync任务 supervisorctl start GameAsync # 停止GameAsync任务 supervisorctl stop GameAsync # 重启GameAsync任务 supervisorctl restart GameAsync
转载请说明出处:
Simon的PHP技术博客
»
ubuntu安装后台进程管理利器: supervisor
34324233333333333333333333333333
11