Reputation: 83
Here's an odd one. I'm running supervisor 3.13 with beanstalkd for a Laravel 4.1 queue. I have a /stage/ and /production/ instances of my app running. I'm running supervisor programs to run artisan queue:listen (out of separate .conf files) for each as follows:
[program:appname-production]
command=php artisan queue:listen --env=production
directory=/home/servername/public_html/production
stdout_logfile=/home/servername/public_html/production/app/storage/logs/supervisord.log
redirect_stderr=true
autostart=true
autorestart=true
The only difference is replacing production with stage in the program. However, when supervisor runs, only the stage program executes correctly. The production program shows FATAL Exited too quickly
appname-production FATAL Exited too quickly (process log may have details)
appname-stage RUNNING pid 6784, uptime 0:32:01
The stage queue is working fine as shown in ps aux. Also, running artisan queue:listen in the production folder works just as it should. When I examine the supervisord log for production however, it's full of:
X-Powered-By: PHP/5.5.20
Content-type: text/html
[InvalidArgumentException]
There are no commands defined in the "queue" namespace.
I've exhausted my technical knowledge of the setup here - I can't seem to reason out why two cloned setups are behaving differently. I've only been able to guess that supervisor is getting boggled somewhere - as I can get the production queue working fine by doing it manually.
All help / ideas are very appreciated.
Upvotes: 1
Views: 974
Reputation: 83
Finally fixed this and wanted to share. Like other solutions, the fix had to do with setting an absolute path to php. However, the PATH var also needed to be set via environment in the subprocess conf. Here we go:
[program:appname]
command=/usr/local/bin/php artisan queue:listen --env=production
directory=/home/appdir
stdout_logfile=/home/appdir/app/storage/logs/supervisord.log
redirect_stderr=true
autostart=true
autorestart=true
environment=PATH="/usr/local/bin"
Hope this helps someone in the future!
Upvotes: 3