I am trying to setup a Process Monitor for php artisan queue:work --tries=3 but I am not sure if I did it right.
Do I also need to reboot my server to make the script work? Right now my supervisor log says “Aug 27 07:18:05 timelytarot supervisord: 2020-08-27 07:18:05,210 INFO gave up: Run-Queues entered FATAL state, too many start retries too quickly” Not sure I did it right.
The main issue here is that supervisor, when trying to run your command, doesn’t know what artisan means.
We usually run php artisan command from within the project folder so it seems like that php artisan is a “global php command” but it is not. In addition to that, supervisor may also not know what php means, but usually it is not the case.
What you need to do is provide full path to your artisan command. While you are at it, set the full path to php as well just in case. Which means you need to do something like:
It is always a good idea to set full paths when running an “automated” script like a Process Monitor to make sure that you always execute what you intend to without anything interfering your call, intentionally or not. I hope that helps.
PS: There could still be other issues after this like your queue is just not working or throwing an exception right off the bat. But you need to fix the path first.
I added the path, looked at the Supervisor log and it shows the following:
Aug 31 18:37:28 timelytarot supervisord: 2020-08-31 18:37:28,306 INFO spawned: ‘Run-Queues’ with pid 27887
Aug 31 18:37:28 timelytarot supervisord: 2020-08-31 18:37:28,532 INFO waiting for Run-Queues to stop
Aug 31 18:37:28 timelytarot supervisord: 2020-08-31 18:37:28,542 INFO stopped: Run-Queues (terminated by SIGTERM)
Aug 31 18:37:28 timelytarot supervisord: 2020-08-31 18:37:28,547 INFO spawned: ‘Run-Queues’ with pid 27889
Aug 31 18:37:29 timelytarot supervisord: 2020-08-31 18:37:29,549 INFO success: Run-Queues entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)