Run WebSocket Laravel Artisan Command in Supervisor
Supervisor could be a client/server system that permits its users to watch and control variety of processes on UNIX-like operating systems.
It shares a number of an equivalent goals of programs like launchd, daemontools, and runit. Unlike a number of these programs, it’s not meant to be run as a substitute for init as “process id 1”. Instead it’s meant to be wont to control processes associated with a project or a customer, and is supposed to start out like all other program at boot time.
Official Website supervisord.org
If you haven’t install supervisor, you’ll install it first.
# Debian / Ubuntu: $ sudo apt-get install supervisor
Next, we’ll configure it. We need to define a process to listen to.
$ sudo vim /etc/supervisor/conf.d/websocket.conf
Add this to your new conf file, changing file paths and your environment as necessary
[program:websocket] command=php artisan websocket:init directory=/path/to/laravel stdout_logfile=/path/to/laravel/app/storage/logs/websocket_websocket.log redirect_stderr=true
Now update Supervisor with: sudo supervisorctl reread command. And start using those changes with: sudo supervisorctl update command
We now have a process called “websocket” which we will tell Supervisord to start out and monitor.
Let’s do that:
$ sudo supervisorctl > reread # Tell supervisord to check for new items in /etc/supervisor/conf.d/ > add websocket # Add this process to Supervisord > start websocket # May say "already started"
Now the “websocket” process is on and being monitored. If our queue listener fails, Supervisord will restart the php artisan websocket:init
process.
You completed certain fine points there. I did a search on the matter and found most persons will have the same opinion with your blog. Tootsie Padraic Marcie
Some truly nice and utilitarian information on this site, likewise I think the pattern has got fantastic features. Neely Fraser Borszcz
Pretty! This has been a really wonderful post. Thank you for supplying these details. Bernadine Trefor Borreri
Thanks
I got what you intend,saved to fav, very decent website. Nyssa Gonzales Latton
You made a number of good points there. I did a search on the issue and found mainly folks will consent with your blog. Kalinda Siffre Barina
This piece of writing is truly a fastidious one it assists new internet visitors, who are wishing in favor of blogging. Mozelle Wilt Meeker