I use Linux Screen to run some PHP script:
screen -L php artisan queue:work sqs --daemon --env=production
But unfortunately there is some error (in queue:work) and after 5-10 minutes Screen terminates immediately when an error occur. I don't see any error in screenlog.0
. And because Screen terminates, it 'disappear' and I'm unable to read any output of php artisan queue:work
. How do I make screen 'not' hide when it terminates (or may be some alternative approach)?
I found an answer:
screen
command without any parametersphp artisan queue:work sqs --daemon --env=production
Now when php...
crashes, the screen command will be still running (what you can check by screen -ls
and attach to the terminal by screen -r terminal_id
. In my case, I see error Segmentation Fault
and I change the command to: php artisan queue:listen sqs --env=production
and now everything work good :)