windows - How will I run queue listener of Laravel 5.2 in background? -


in project using database queue , executing queue using command

php artisan queue:listen

in composer , working. in windows server, there many projects using queues many windows of composer open. quite inconvenient. possible run command in background without composer window open?

you can use command work until logout or restart

nohup php artisan queue:work --daemon & 

the trailing ampersand (&) causes process start in background, can continue use shell , not have wait until script finished.

see nohup

nohup - run command immune hangups, output non-tty

this output information file entitled nohup.out in directory run command. if have no interest in output can redirect stdout , stderr /dev/null, or output normal laravel log. example

nohup php artisan queue:work --daemon > /dev/null 2>&1 &  nohup php artisan queue:work --daemon > app/storage/logs/laravel.log & 

but should use supervisord ensure service remains running , restarted after crashes/failures.

running queue:listen supervisord

supervisord *nix utility monitor , control processes below portion of /etc/supervisord.conf works well.

portion of supervisord.conf queue:listen

[program:l5beauty-queue-listen] command=php /path/to/l5beauty/artisan queue:listen user=nonroot-user process_name=%(program_name)s_%(process_num)d directory=/path/to/l5beauty stdout_logfile=/path/to/l5beauty/storage/logs/supervisord.log redirect_stderr=true numprocs=1 

you’ll need replace /path/to/ match local install. likewise, user setting unique installation.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -