CoTURN server stops after some time

784 Views Asked by At

I've installed CoTURN on Ubuntu 16.04 server. I'm starting the TURN server with the below command:

turnserver -a -o -v -n --cert /etc/letsencrypt/live/mydomain.com/fullchain.pem --pkey /etc/letsencrypt/live/mydomain.com/privkey.pem -u username:password -r "mydomain.com"

I check with Trickle ice and it works fine. But after some random time (typically in days) it stops working/shuts down.

Is there any way to run it forever or at least get an email if the service stops? Thanks!

1

There are 1 best solutions below

1
On

I use the NPM tool called PM2 for that. If the service goes down, you can get notifications. Monit can do that - and also restart if necessary.

  1. npm i pm2
  2. pm2 start turnserver
  3. sudo apt install monit
  4. nano /etc/monit/monitrc

Here you can find examples how to enable a specific service. In your case it's the turnserver.

Config