0

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.

Twoscore
  • 85
  • 2
  • 6
  • 1
    Please try the community answer to this question, which is sorted out in https://github.com/drud/ddev-contrib/tree/master/web-container-dockerfiles/laravel-queue-worker - if that doesn't do it for you, you might want to follow up with an issue in ddev-contrib, mentioning @karlshea, who created that recipe. – rfay Jan 01 '21 at 13:40

1 Answers1

-1

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

Rahul Kr Daman
  • 387
  • 3
  • 15