【问题标题】:Beanstalkd to start when the system starts up or reboots , how to uncomment "START yes" on CentosBeanstalkd 在系统启动或重启时启动,如何在 Centos 上取消注释“START yes”
【发布时间】:2017-03-28 19:19:38
【问题描述】:
我在 Centos 6 上的 Laravel 中使用 Beanstalkd 进行队列,我发现我需要取消注释以下 START=yes 以便 Beanstalkd 在系统启动时启动启动或重启
当我从根目录运行此命令nano /etc/default/beanstalkd 时,我找不到该文件。
或者如果有其他方法可以启用它,请告诉我。
【问题讨论】:
标签:
linux
laravel
centos6
task-queue
beanstalkd
【解决方案1】:
为了让 php 一直监听,你需要安装 Supervisord 然后执行以下操作
- 通过运行以下命令找到此文件 supervisord.conf:
find / -name supervisord.conf
- 你会得到这样的路径
/etc/supervisord.conf
- 编辑文件
sudo nano /etc/supervisord.conf
- 制作
autostart=true和autorestart=true
-
在底部,有这样的东西
[program:laravel-queue-listener] command=php
/var/www/YourProjectNameHere/artisan queue:listen --env=prod --timeout=0
然后重启supervisord:sudo service supervisord restart
也重启 beanstalkd:sudo service beanstalkd restart
所有队列都会被自动监听,无需手动运行php artisan queue:listen --timeout=0