TeamSpeak 3 and DreamHost VPS since Ubuntu

My VPS was recently transitioned from Debian to Ubuntu. Prior to this switch, in addition to hosting my website, I used the VPS to run a stable and popular TeamSpeak3 server.

Many small organizations (business/teams/guilds/clans/etc…) use the unlicensed version of TeamSpeak which allows for up to 32 client connections without a paid (or non-profit organization) license. Unlicensed TS3 requires the use of a tmpfs file system in /dev/shm, which (since the Ubuntu upgrade) is removed from my system.

The issue is described in the TeamSpeak 3 knowledge base here as well as in their “server quick start guide”, here. TS3 requires tmpfs in order to ensure that only a single instance of (unlicensed) TS3 is running per host machine. There is no alternative to this, and no patch or hack that I have been able to find to use a different temporary directory.

As virtual machine tenants we are prohibited from mounting our own tmpfs file system, and DreamHost admin staff were not inclined to mount tmpfs on my behalf. I am hopeful that this policy can be reconsidered, or a workaround can be developed as I’m confident that other software besides TeamSpeak (which is very popular in it’s own right) takes advantage of storing small packets of data in tmpfs memory.

This is a frustrating setback, as I had hoped the OS transition (which already caused substantial uncompensated downtime) has harmed the continued functioning of my site and it’s staff. If anyone has any bright ideas, I’m open to suggestions. As it stands I may have to purchase a paid license for TeamSpeak in order to avoid the tmpfs instance check, which is frustrating as my use case otherwise is fully compliant with the capabilities of the standard unlicensed version.

/tmp is configured as a tmpfs by default on DreamHost VPSes. I’m not familiar with TeamSpeak, but I wonder if you can make it use that by changing the configuration, or by setting up /dev/shm as a symbolic link to /tmp? (You may have to remove the empty directory at /dev/shm first, using an admin user.)

Hi Andrew,

Thank you for the suggestion. If /tmp WERE set up as tmpfs, I might (maybe?) be able to make something work. As it stands, no file system was assigned to /tmp and I am unable to assign one myself. Here is my df -h

[psXXXXXX]$ df -h Filesystem Size Used Avail Use% Mounted on /dev/hdv1 3.6T 308G 3.3T 9% / none 128M 816K 128M 1% /tmp

“none” is the device associated with the filesystem; this value is normal for a tmpfs (since it isn’t a device at all). You can view the filesystem type by running “mount” — the results should look something like:

[quote]/dev/hdv1 on / type ufs (defaults)
none on /proc type proc (defaults)
none on /tmp type tmpfs (size=128m,mode=1777,nosuid,noexec,nodev)
none on /dev/pts type devpts (gid=5,mode=620)[/quote]

Ok, I removed the shm directory and created a symbolic link in it’s place pointing to /tmp. I verified that the link was working and tried to restart the TS server. Here’s the output of my log (which I realize won’t be very meaningful to you)

2013-10-10 21:43:22.159816|INFO |ServerLibPriv | | TeamSpeak 3 Server 3.0.10 (2013-09-27 10:13:58) 2013-10-10 21:43:22.160518|INFO |ServerLibPriv | | SystemInformation: Linux 3.1.9-vs2.3.2.5 #1 SMP Thu Jan 26 02:37:05 UTC 2012 x86_64 Binary: 64bit 2013-10-10 21:43:22.163023|INFO |DatabaseQuery | | dbPlugin name: SQLite3 plugin, Version 2, (c)TeamSpeak Systems GmbH 2013-10-10 21:43:22.163107|INFO |DatabaseQuery | | dbPlugin version: 3.7.3 2013-10-10 21:43:22.163790|INFO |DatabaseQuery | | checking database integrity (may take a while) 2013-10-10 21:43:22.769648|ERROR |Accounting | | failed to register local accounting service 2013-10-10 21:43:22.769765|ERROR |ServerLibPriv | | Server() error while starting servermanager, error: instance check error

This is the same error, and corresponds exactly to the one described in the TeamSpeak documentation. Here are the steps that the TeamSpeak support personnel instruct me to take:

In some cases, the server process terminates on startup and the error message reads
"Server() error while starting servermanager, error: instance check error".

As long as you don’t have a license key embededded we make sure you only run exactly
one instance of the TS3 server free unregistered version. We use shared memory to
facilitate the communication to detect other running instances, which requires tmpfs
to be mounted at /dev/shm. If you (for whatever reason) do not have this mounted, the
above error will occur.

To fix this problem, the following commands or file edits need to be done as root user
(or using something like sudo). This is a temporary fix until your next reboot.

mount -t tmpfs tmpfs /dev/shm

Now, to make sure this mount is done automatically upon reboot edit the file /etc/fstab
and add the line:

tmpfs /dev/shm tmpfs defaults 0 0

It looks like a symbolic link isn’t going to be sufficient :frowning: Any other ideas?

Is there no chance of getting tmpfs mounted in /dev/shm on my behalf? My organization is pretty crippled at the moment with no voice communication. I’m open to trying other ideas, but it seems like this is a known issue/fix that is contingent on a specific server setup.

I was poking at Teamspeak on your server a minute ago and I think I got it to run, half by accident — it looks as though the problem may have been a stale file called “7gbhujb54g8z9hu43jre8” in /tmp (this appears to be a standard Teamspeak thing!) owned by root. Perhaps you tried to start Teamspeak as root earlier and it left that behind, preventing it from starting up properly as your TS user?

If that’s not it, let me know and I’ll keep looking (or leave it alone, if you prefer).

As an update for anyone else who experiences a similar problem with TeamSpeak:

I was able to start the server by running the start script as an admin (sudo) user. This is pretty strongly not recommended by the TS3 developers, but it was the only way I was able to get the server to start. I’m not sure why running the script as sudo would work, as I should have access to the /tmp directory on the normal teamspeak user.

It’s at least a temporary solution, although one that makes me a bit uncomfortable because the server is running under the root user. I think I’m going to pursue getting a server license so that it bypasses the instantiation check, but that takes some time to process.

Okay, now I’m not sure which one of us actually fixed it now. :slight_smile: Either way, if that works for you, I suppose that’s good… I still kind of wonder if you may just be dealing with some lingering permissions issues now, though. There’s certainly no reason that /tmp should require root.

Ok, I poked around a bit more, and was able to stop, and restart the server again. Once again, I had to sudo the startscript in order to get it to run. It must be a permissions issue of some sort, but I don’t understand it myself because everything in the teamspeak folder is owned by the user who was attempting to run the script.

I’ll have to investigate a bit further what some of the security concerns are if I’m running the server as root. In the meantime, I’ve filed for a non-profit license which would allow me to bypass the instance check, so once that comes through, I’ll provide an update.

Thank you for your help @Andrew-F, I appreciate you taking a look at it.

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.