2

I have a page which supports some kind of mail notificiation. When user inserts some data, I want to send mail to another. I know, Mail::send() works perfectly, but it is slow. So I want to push this mail to queue. I use iron.io as provider. Everything works perfectly until I close console.

So is it possible to run php artisan queue:listen forever after I close console on Win and Linux?

1 Answer 1

10

You can run every process in the background in linux by using nohup

nohup php artisan queue:listen

This will keep the process running even if you close your terminal, nohup will force to ignore hangup signals.

nohup creates a logfile. If you want to suppress this, you can add

 >/dev/null 2>&1 &

after your command

Sign up to request clarification or add additional context in comments.

5 Comments

Thank you, this helped a lot, also with this answer stackoverflow.com/questions/24646320/…
Consider monitoring this with something like supervisord too.
You're welcome! You can ignore what nohup is telling you and close everything. You could build some kind of checkup if the process is still running, though it's quite reliable
I do not have root user of cmd, so when I set nohup command and then close the terminal, the queue stops. The command or process is not running in background as expected. My question is, using non root user could be the issue here?
@HimanshuUpadhyay Feel free to ask a new question and make sure to include all the information about what you are doing so that people can help you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.