Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I'm quite new to linux but I'm starting to understand it. I have a Ubuntu Server 12.04 system, fresh install, and I installed a teamspeak 3 server on it:

$ sudo useradd teamspeak
(provided user info and password)
$ su teamspeak
(entered password)
$ cd /home/teamspeak
$ wget http://ftp.4players.de/pub/hosted/ts3/releases/
(download teamspeak.tar.gz)
$ tar -zxvf teamspeak3-server_linux-amd64-
(unpacked the file to teamspeak3-server_linux-amd64)
$ mv teamspeak3-server_linux-amd64 server
(server is no located in /home/teamspeak/server)
$ cd ./server
$ ./ts3server_minimal_runscript.sh createinifile=1
(initialized the server)
$ ./ts3server_startscript.sh start
(started the server)

Now when I reboot my server (e.g. $ sudo reboot) the server doesn't start up. Obviously because I haven't configured anything in /etc/init.d but I have no idea how to do this.

I want the server to start like it does with the /home/teamspeak/server/ts3server_startscript.sh start script, ran by the user teamspeak.

I followed several guides but they didn't work. Can someone help me?

share|improve this question
up vote 4 down vote accepted

I recommend creating an Upstart script.

First you want to create the script itself: sudo nano /etc/init/ts-server.conf

Copy and paste this skeleton and make any changes you need:

# description "start and stop the TS server"

console log # Log events to console

exec start-stop-daemon --start --chdir /home/teamspeak/server/ --chuid teamspeak \
    --exec /home/teamspeak/server/ts3server_startscript.sh start

 start on runlevel [2345] # Tell when to start
stop on runlevel [^2345] # Tell when to stop

respawn # Block excess respawn
respawn limit 20 5 # Ditto

Save that file, go to /home/teamspeak/server/ and create a file ts3server_upstart.sh

/home/teamspeak/server/ts3server_startscript.sh start

Save, mark it as execuatable, done! It'll start on boot, and can be manually started/stopped/restarted using sudo service ts-server start, sudo service ts-server stop, and sudo service ts-server restart, respectively.

EDIT: This may not actually STOP TeamSpeak. I do not know enough about TS and starting to tell you whether it will or will not.

share|improve this answer
Can you explain what you did. I'm a bit of a noob and I like to understand what I'm doing. Thanks for your answer though, I'll give it a go.. – Jochem Kuijpers Jan 11 '14 at 22:36
Basically the first part is creating something known as Upstart, Ubuntu's program for launching stuff at boot. The second part is creating a script for Upstart to launch. I will edit with comments. – Kaz Wolfe Jan 11 '14 at 22:41
Thanks for editing with comments, it doesn't quite work.. When I reboot the server, ssh and execute htop, I don't see a process executing from teamspeak, neither do I see a process that is the teamspeak server, and I cannot connect to it from my desktop/laptop. When I run ts3server_startscript.sh start I can, and when I run sudo ./ts3server_startscript.sh stop it stops. When I run sudo service ts-server start|stop|restart it says it starts but doesn't and gives errors with stop or restart: stop: Unknown instance: and stop: Unknown instance: ts-server start/running, process 1344. – Jochem Kuijpers Jan 11 '14 at 22:51
hmm. that is interesting, – Kaz Wolfe Jan 11 '14 at 22:54
edited post. try the new version. – Kaz Wolfe Jan 11 '14 at 22:55

This is the upstart script I use, mostly a rip off of Mew's:

description "Teamspeak 3"

console log # Log events to console

setuid teamspeak
setgid teamspeak

exec /opt/teamspeak/ts3server_minimal_runscript.sh

start on runlevel [2345] # Tell when to start
stop on runlevel [^2345] # Tell when to stop

respawn # Block excess respawn
respawn limit 20 5 # Ditto

It requires upstart 1.4 or higher for setuid/setgid, but Ubuntu 12.04 provides that. If you don't have that you can just change the exec line to be exec su -s /bin/sh -c /opt/teamspeak/ts3server_minimal_runscript.sh teamspeak instead.

The main difference is that it uses ts3server_minimal_runscript.sh instead, which doesn't fork. ts3server_startscript.sh is meant to be used as a sort of init script so it forks - which isn't necessary for upstart. When used with upstart it means that you can't do commands like service ts-server status or even service ts-server stop. With this script you can.

share|improve this answer

I have followed step by step in this tutorial, everything is describe, how to install and configure TeamSpeak3 server with MySQL - MariaDB on Debian/Ubuntu. http://terminal28.com/how-to-install-and-configure-teamspeak3-server-linux-debian-ubuntu/

share|improve this answer
Welcome to Unix & Linux! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Anthon Jan 25 '15 at 8:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.