@playing_life Redis local server installed ??
Laravel Workers with Supervisord not processing jobs
I have a container built from image thecodingmachine/php:8.1-v4-slim-apache. I have setup supervisor like so:
supervisord.conf
[unix_http_server]
file=/var/run/supervisor.sock
chmod=0700
[supervisord]
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid
childlogdir=/var/log/supervisor
directory=/var/www/html
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock
[include]
files = /etc/supervisor/conf.d/*.conf
and a worker that I want to start
worker.conf
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php artisan queue:work
startsecs = 0
autostart=true
autorestart=true
user=docker
numprocs=3
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-worker.log
stopwaitsecs=3600
directory=/var/www/html
[eventlistener:email_on_process_stop]
process_name=%(program_name)s_%(process_num)02d
command=/usr/bin/php /var/www/html/docker/scripts/emailOnProcessStop.php
events=PROCESS_STATE_STARTING,PROCESS_STATE_RUNNING,PROCESS_STATE_STOPPED
buffer_size=10
numprocs=2
user=docker
autostart=true
autorestart=unexpected
directory=/var/www/html
#directory=/var/www/html/docker/scripts
#stderr_logfile=/var/www/html/docker/scripts/emailOnProcessStop_err.log
When I start the wroker with supervisor, the command "php artisan queue:work" is there in the processes list but no job is processed. I logged in into the container and if I run the command manually jobs are processed correctly. But, if I run "sudo su docker" OR "su docker" (I'm switching to the same current user) first and then run the command, again no jobs are processed. It looks like if I'm sudo-ing or switching users, even to the same user, the worker does not see the jobs or something. On my local development it works to process jobs sudo-ing or switching users, but on the production server it does not.
Maybe someone has encountered this situation or has any ideea. Thank you
Please or to participate in this conversation.