IJAZ ALI

VUE JS Developer

Laravel Developer

Freelancer

Full Stack Developer

IJAZ ALI

VUE JS Developer

Laravel Developer

Freelancer

Full Stack Developer

Blog Post

Run WebSocket Laravel Artisan Command in Supervisor

June 8, 2020 Linux, Ubuntu

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.

Taggs:
7 Comments
  • erotik 12:15 pm November 13, 2020 Reply

    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

  • erotik izle 1:12 pm November 15, 2020 Reply

    Some truly nice and utilitarian information on this site, likewise I think the pattern has got fantastic features. Neely Fraser Borszcz

  • sikis izle 9:39 pm November 15, 2020 Reply

    Pretty! This has been a really wonderful post. Thank you for supplying these details. Bernadine Trefor Borreri

  • sikis izle 2:00 am November 17, 2020 Reply

    I got what you intend,saved to fav, very decent website. Nyssa Gonzales Latton

  • sikis izle 12:37 pm November 17, 2020 Reply

    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

  • erotik izle 1:10 am November 20, 2020 Reply

    This piece of writing is truly a fastidious one it assists new internet visitors, who are wishing in favor of blogging. Mozelle Wilt Meeker

Write a comment