[英]Laravel 8 setting up supervisor .conf file for DDEV development
I am trying to set-up a supervisor to process a queue.我正在尝试设置主管来处理队列。 I am pretty sure it has to do with the scope the.conf is running in due to DDEV but I am not 100% sure.我很确定它与 scope 由于 DDEV 而运行,但我不是 100% 确定。
Here is my current .conf
这是我当前的.conf
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/artisan queue:work redis
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=www-data
numprocs=5
redirect_stderr=true
stdout_logfile=/home/user/app/workers.log
Running in this directory /var/www/html
I got this error:在此目录/var/www/html
中运行我收到此错误:
supervisor: couldn't chdir to /var/www/html: ENOENT
supervisor: child process was not spawned
Other things I have tried我尝试过的其他事情
I have tried running in directory /home/user/app/artisan
and that actually works kinda.我试过在目录/home/user/app/artisan
中运行,这实际上有点工作。 It does start workers but they are not listening on the right scope cause of DDEV it needs to be in the /var/www/html
directory which is also where I ssh via ddev ssh
.它确实启动了工作人员,但他们没有在正确的 scope 上侦听 DDEV 的原因,它需要位于/var/www/html
目录中,这也是我通过ddev ssh
的位置Speaking of which I have also already tried changing the.conf to说到这我也已经尝试将.conf更改为
directory=/home/user/app
command=ddev exec php artisan queue:work redis
I got an error about it not recognizing ddev command but it runs fine from command line.我收到一个关于它无法识别 ddev 命令的错误,但它从命令行运行良好。
If any additional information is needed let me know.如果需要任何其他信息,请告诉我。
Once the configuration file has been created, you may update the Supervisor configuration and start the processes using the following commands:创建配置文件后,您可以使用以下命令更新 Supervisor 配置并启动进程:
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start laravel-worker:*
For more information on Supervisor, Please Check Here - http://supervisord.org/index.html有关 Supervisor 的更多信息,请在此处查看 - http://supervisord.org/index.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.