Developers Documentation

×

Warning

301 error for file:https://clearos.com/dokuwiki2/lib/exe/css.php?t=dokuwiki&tseed=82873f9c9a1f5784b951644363f20ef8

User Tools

Site Tools


Team Speak 2

I have also included a TeamSpeak 3 startup script at the bottom. - This has not been tested.

Install Program Tools

SSH logon

You can pickup WinSCP here; http://winscp.net/eng/index.php

Putty here; http://www.chiark.greenend.org.uk/~sgtatham/putty/ This all could be done via Putty too if you want.

Get the latest version of Team Speak 2 Download here http://www.teamspeak.com/?page=downloads&archive=1

Get the latest version of Team Speak 3 Download here http://www.teamspeak.com/?page=downloads

Install Team Speak 2

Create a new user within the Webgui

User:       ts2
Name:       Team Speak
Last Name:  Server 

Everything else is up to you, but don’t give it access to anything

Logon to you ClearOS box via SSH

Go: /home/ts2

Copy the ts2_server_rc2_VERSION.tar.bz22 file into this directory

Command chown ts2:allusers ts2_server_rc2_VERSION.tar.bz2

What is the command for tar to open a bz2 file?

Type:  tar -xzf ts2_server_rc2_VERSION.tar.bz2

You can delete the zip file if you like

Type:  chown -R ts2:allusers /home/ts2/tss2_rc2
Type:  chmod -R 0755 /home/ts2/tss2_rc2
Type:  cd / home/ts2.tss2_rc2/
Type:  mv server_linux server

Renaming the Server_linux file to server is to run the script created below. If you want to use the default setting listed in TS docs, don't change this… please provide options that you have used in the Forum threads

TeamSpeak has a great web interface that you can create and setup your TeamSpeak server. you can usually find it here.

http://yourdomain.com:14534

TeamSpeak also has a website to check to see if all ports are working etc.

Modifying your Script File

Next will be to create script file so you can load the service from CLI or later in the webgui.

You need to run the service in order for it to create some files, including the .log file.

Copy the text below into a script file

Location of the file

/etc/rc.d/init.d/

Name the script file

ts2

Enter the following information into the script file.

You can do this many ways, either by nano in the CLI (Command Line Interface) or use WinSCP to create the edit the file.

This is a modified ventrilo script, it has been tested and works. I didn't change the some specific vent wording due to time, but if you want you can change it too.

#!/bin/bash
#
# Team Speak This shell script takes care of starting and stopping
# the Team Speak Subsystem (ts). 
#
# chkconfig: - 90 10
# description: Team Speak Server.
# processname: server
# config: /do_not_remove/server.ini
# pidfile: /do_not_remove/server.pid
# Source function library.
. /etc/rc.d/init.d/functions

# CONFIG
prog="Team Speak 2"
vent_path=/home/ts2/tss2_rc2          # <----  Replace with the path to your /tss_rc2 directory
vent_user=ts2                         # <----  Replace with sudo user
vent_bin=$vent_path/
vent_server=server
vent_log=/var/logs/ts2/server.log
vent_pid=$vent_path/server.pid
# Startup Team Speak 2 servers.
start(){
sudo -u $vent_user $vent_path/$vent_server
ret=0
if [ $ret -eq 0 ]; then
STARTTIMEOUT=30
while [ $STARTTIMEOUT -gt 0 ]; do
RESPONSE=`ls -al server.pid 2>&1` && break
echo "$RESPONSE" | grep -q "root" && break
break
sleep 1
let STARTTIMEOUT=${STARTTIMEOUT}-1
done
if [ $STARTTIMEOUT -eq 0 ]; then
echo "Timeout error occurred trying to start $prog Daemon."
action $"Starting $prog: " /bin/false
else
action $"Starting $prog: " /bin/true
fi
else
action $"Starting $prog: " /bin/false
fi

return $ret 
}
stop(){
VENTPID=`cat "$vent_pid" 2>/dev/null `
if [ -n "$VENTPID" ]; then
/bin/kill "$VENTPID" >/dev/null 2>&1
ret=$?
if [ $ret -eq 0 ]; then
STOPTIMEOUT=60
while [ $STOPTIMEOUT -gt 0 ]; do
/bin/kill -0 "$VENTPID" >/dev/null 2>&1 || break
sleep 1
let STOPTIMEOUT=${STOPTIMEOUT}-1
done
if [ $STOPTIMEOUT -eq 0 ]; then
echo "Timeout error occurred trying to stop $prog Daemon."
ret=1
action $"Stopping $prog: " /bin/false
else
action $"Stopping $prog: " /bin/true
fi
else
action $"Stopping $prog: " /bin/false
fi
else
ret=1
action $"Stopping $prog: " /bin/false
fi
return $ret
}
restart(){
stop
start
}
password(){
if [ -e $vent_path/server.log ]; then
date=$(cat $vent_path/server.log | grep "admin account info: username:admin" | tail -n 1 | sed "s/^\([0-9]\+-[0-9]\+-[0-9]\+ [0-9]\+:[0-9]\+:[0-9]\+\).*$/\1/")
spass=$(cat $vent_path/server.log | grep "superadmin account info: username: superadmin" | tail -n 1 | sed "s/^.*username: superadmin password: \([a-z0-9]\+\).*$/\1/")
pass=$(cat $vent_path/server.log | grep "admin account info: username: admin" | tail -n 1 | sed "s/^.*username: admin password: \([a-z0-9]\+\).*$/\1/")
echo "Following passwords were generated on $date"
echo "superadmin = \"$spass\""
echo "admin      = \"$pass\""
else
echo "server.log not found; maybe the server has not been started yet?" 
exit 1
fi 
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status vent
;;
restart)
restart
;;
password)
password
;;
*)
echo $"Usage: $0 {start|stop|status|restart|password}"
exit 1
esac

Copy the same text above into a file and put it under

  chown ts2:allusers /etc/rc.d/init.d/ts2server
  chmod +xw /etc/rc.d/init.d/ts2server
  chmod 755 /etc/rc.d/init.d/ts2
  chkconfig --add ventrilo 
  chkconfig --levels 345 ventrilo on && chkconfig --list ventrilo

Now you can start your server

  Type: service ts2 start

Then you should see the system come back as “OK” in green.

  service ts2 restart
  service ts2 stop

===== Almost Done =====

Next we need to create a link file under the /var/log so we can view it via the webgui.

  Type: mkdir /var/log/ts2
  Type: chown -R ts2:allusers /var/log/ts2
  Type: cp /home/ts2/tss2_rc2/server.log /var/log/tss2/server.log
  Type: rm /home/ts2/tss2_rc2/server.log
  Type: ln -s /var/log/tss2/server.log /home/ts2/tss2_rc2/server.log

Now restart the webconfig service

  Type: service webconfig restart 

Now you should be able to access your log menu and see

  ts2/server.log

Next we'll want to add the necessary changes to the webgui in order to see the server as a service.

You need to locate the following file.


 /var/webconfig/api/daemon.inc.php

And insert this line.

"ts2"     => array("httpd",        "server",     "no",  "Team Speak 2 Server",     "no",  null),

Restart the webconfig

Type:  service webconfig restart

You should be all done!!!

content/en_us/kb_howtos_installing_teamspeak_2_on_clearos.txt · Last modified: 2015/02/11 10:18 (external edit)

https://clearos.com/dokuwiki2/lib/exe/indexer.php?id=content%3Aen_us%3Akb_howtos_installing_teamspeak_2_on_clearos&1710826360