Since this was a specific question related to Laravel, I thought I was offering a specific answer to Lravel. Since you are already using cronjob on this server, I would recommend that you configure the shell command as a repeating cronjob to always check that the worker is working. You can either configure the shell command to run initially through cron on your server, or you can use the Laravel console kernel to manage the command and add logic, for example, check if you already have a working worker and, if not, go ahead and run it .
Depending on how often you need to carry out your team, you can do this infrequently, once a week, or even once a minute. This will give you the opportunity to make sure that your employees are constantly working without adding any overhead to your server, such as Supervisor. Granting permissions for a third-party package, such as a supervisor, is fine if you trust it, but if you can avoid having to rely on it, you might want to consider this approach.
An example of using this to do what you want will be a cronjob that runs every hour. It will do the following in sequential order from the Laravel console user command:
\ Artisan :: call ('queues: reboot');
\ Artisan :: call ('queue: work --daemon');
Please note that this applies to older versions of Laravel (prior to 5.3), but I have not tested them in newer versions.
eResourcesInc
source share