Re: [discuss-webrtc] How do I install turnserver as a service with automatic boot on Linux.

333 views
Skip to first unread message

Adam Fineberg

unread,
May 9, 2013, 1:18:33 PM5/9/13
to discuss...@googlegroups.com
Services are run using chkconfig (run chkconfig --list to see the currently configured services).  The scripts that control this are in /etc/init.d.  You can use one of those as a template to create an init script for your server and then run chkconfig --add "scriptname" and chkconfig "scriptname" on.

On 5/8/13 1:04 PM, Anders Both wrote:
Hi

I succesfully installed rfc5766-turn-server on EC2. (I will post a Windows users short guide to rfc5766-turn-server on Linux and EC2 later).

This may be elementary Linux knowledge:

How do I install it as a service ?

Best regards,

Anders Both
Denmark.
--
 
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Regards,
Adam

Bob Wolff

unread,
May 9, 2013, 1:53:12 PM5/9/13
to discuss...@googlegroups.com
Anders,

Another method is to do this via /etc/inittab. This method allows for a 'respawn' which means that if the service dies for any reason, inittab will automatically re-start it which I find very useful. Here is my config line for our EC2 servers.

/etc/inittab ... add a line....
tu:2345:respawn:su -l -c "/usr/local/bin/turnserver -s 80000 -n -f -a -b /etc/turnuserdb.conf -X [elastic-ip-address] -r [your-realm] --no-tls --no-dtls"

Bob Wolff - CTO GoCast It, Inc. - http://www.gocast.it

Oleg Moskalenko

unread,
May 9, 2013, 2:19:30 PM5/9/13
to discuss...@googlegroups.com
I sent a short guide to Anders over email, if anybody is interested I am coping it here:

========================================

different Linuxes have somewhat different ways to set up a system service.

In general, the algorithm is:

1) create a start-up script into /etc/init.d/ directory;
2) create a script parameters file in /etc/default/ directory; (optional step)
3) create links to the start-up script in /etc/rc3.d/ directory (for "normal" "level 3" system usage).

The Debian packages posted in the http://rfc5766-turn-server.googlecode.com Downloads take care about everything - the user just have to enable the service in /etc/default/rfc5766-turn-server file. If you can use Debian Wheezy, Ubuntu 12.* or Linux Mint 14+, then you can use those packages to set up everything automatically. Or you can set a temporary virtual machine with Ubuntu, then install the turn server with the package in it, then you can use the created scripts as examples for your Linux distribution.

Of course, you can run the turn server "manually". You are not bound by your SSH terminal lifetime. Just make the command:

$ nohup turnserver >>/dev/null 2>>/dev/null

then you can exit the terminal.

In a similar way, the turnserver can be started as a daemon "manually":

$ turnserver -o ...

then you can exit the terminal.

============================================

Regards,
Oleg

Oleg Moskalenko

unread,
May 9, 2013, 2:32:44 PM5/9/13
to discuss...@googlegroups.com
This is a good point.

Although, not all Linuxes have /etc/inittab, as far as I can see. But if that works for EC2, then that is great.

Oleg

Anders Both

unread,
May 17, 2013, 11:06:48 AM5/17/13
to discuss...@googlegroups.com
Thanks!. My turnserver is now running as a service

I used this example to make the starup-script 
Reply all
Reply to author
Forward
0 new messages