Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
762 views
in Technique[技术] by (71.8m points)

php - 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.

Here is my current .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:

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. 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. Speaking of which I have also already tried changing the .conf to

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.

If any additional information is needed let me know.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Once the configuration file has been created, you may update the Supervisor configuration and start the processes using the following commands:

sudo supervisorctl reread

sudo supervisorctl update

sudo supervisorctl start laravel-worker:*

For more information on Supervisor, Please Check Here - http://supervisord.org/index.html


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...