Systemd Unit

From TeamSpeak Wiki
Jump to navigation Jump to search

This mainly applies to CentOS 7 and Ubuntu 18.04+, there are advantages to using this method as it also enables monitoring of the TeamSpeak 3 Server as well as starting the TeamSpeak instance on boot.

Copy the following in to a systemd unit file of your choosing, we'll use /etc/systemd/system/teamspeak.service, you will need to change the lines WorkingDirectory, ExecStart, ExecStop and ExecReload if you installed the server in a different folder and the user= line if you made a UNIX user other than "teamspeak".

Description=TeamSpeak3 Server

ExecStart=/home/teamspeak/teamspeak3-server_linux-amd64/ start initfile=ts3server.ini
ExecStop=/home/teamspeak/teamspeak3-server_linux-amd64/ stop
ExecReload=/home/teamspeak/teamspeak3-server_linux-amd64/ restart

After you've saved the file you need to enable the unit by running :

systemctl enable teamspeak

As a bonus, you can now use systemd to start, stop and reload your server by using

systemctl start teamspeak
systemctl stop teamspeak
systemctl reload teamspeak