ivan1986 / supervisor
控制Supervisord
1.0.1
2016-09-07 07:19 UTC
Requires
- symfony/dependency-injection: ~2.1|~3.0
- symfony/framework-bundle: ~2.1|~3.0
- symfony/process: ~2.1|~3.0
- symfony/twig-bundle: ~2.1|~3.0
This package is not auto-updated.
Last update: 2024-09-28 15:03:17 UTC
README
此包用于快速配置和使用单独的supervisord实例。
所有Symfony2命令都从kernel.root dir路径运行supervisor。如果使用supervisor:init创建的配置,请使用本地配置文件。
默认通过composer安装
"ivan1986/supervisor": "*",
初始化包
new Ivan1986\SupervisorBundle\SupervisorBundle(),
包有命令
- supervisor:init
- 在app文件夹中创建supervisord.conf文件和supervisor文件夹
- supervisor:run
- 检查supervisord实例并在需要时运行它
- 将此命令添加到cron - supervisord的简单快速看门狗
- supervisor:control
- 运行任何supervisorCtl命令
- supervisor:gen
- 为symfony2控制台命令生成简单的程序段
为rabbitmq扩展工作者的示例代码。
$this->get('supervisor')->genProgrammConf('worker', array(
'name' => 'worker',
'command' => 'rabbitmq:consumer sender',
'numprocs' => $this->getNeedWorkersCount(),
));
$this->get('supervisor')->run();
$this->get('supervisor')->reloadAndUpdate();
服务supervisor可以运行守护进程、执行任何命令并为supervisord生成文件。
此外,supervisord还可以通过参数配置的-i运行。如果没有这个列表中的/usr/bin/python /usr/bin/supervisord在进程列表中 - 看起来很棒 :)