TS3 upstart script and general setup for Debian based distro

mercredi 16 septembre 2015

1. Install TS3 into /opt/teamspeak. Make sure the permissions on a directory are sensible.
2. Make a symbolic link from TS3 binary to ts3server_linux
I.e.
Code:

ln -s /opt/teamspeak/ts3server_linux_x86 /opt/teamspeak/ts3server_linux
3. Create a system user named "teamspeak" with home directory /var/lib/teamspeak
4. Copy ts3.ini from distribution to the user home directory.
5. Uncomment and adjust the following lines exactly as shown:
Code:

query_ip=127.0.0.1
query_port=10011
logpath=/var/log/teamspeak
dbsqlpath=/opt/teamspeak/sql/
dbsqlcreatepath=create_sqlite
licensepath=/var/lib/teamspeak
query_ip_whitelist=/var/lib/teamspeak/query_ip_whitelist.txt
query_ip_blacklist=/var/lib/teamspeak/query_ip_blacklist.txt
query_skipbruteforcecheck=1
logquerycommands=1

Pay close attention to dbsql* settings, they are most backwards and most important.

6. Create /var/log/teamspeak directory.
7. chown teamspeak:adm /var/log/teamspeak
8. Install /etc/init/teamspeak.conf as follows:
Code:

description "TeamSpeak3 upstart job"
# $Id: teamspeak.conf 236 2015-07-16 06:39:48Z anrdaemon $
author "Andrey Repin <anrdaemon@yandex.ru>"
usage "$UPSTART_JOB"

start on local-filesystems and net-device-up IFACE!=lo
stop on runlevel [016]

kill signal SIGTERM
kill timeout 600

setuid teamspeak
setgid nogroup
chdir /var/lib/teamspeak

console log

env DAEMON="/opt/teamspeak/ts3server_linux"
env LD_LIBRARY_PATH="/opt/teamspeak:$LD_LIBRARY_PATH"
env HOME="/var/lib/teamspeak"
env CONFFILE="/var/lib/teamspeak/ts3.ini"

pre-start script
    test -n "$DEBUG" && set -x
    test -x "$DAEMON" || exit 1
    test $(id -u) -ne 0 || {
            /usr/bin/logger -ist $UPSTART_JOB -p user.err -- "Do not run TeamSpeak3 as root! Specify correct setuid name!"
            exit 1
        }
    test -r "$CONFFILE" || {
            /usr/bin/logger -ist $UPSTART_JOB -p user.err -- "TeamSpeak3 main configuration file is missing. Check \$HOME path and setuid name."
            exit 1
        }
    /usr/bin/logger -ist $UPSTART_JOB -- "Attempting to start '$DAEMON' from '$CONFFILE'"
end script

exec "$DAEMON" inifile="$CONFFILE" $OPTIONS

9. service start teamspeak
10. Enjoy.
TS3 upstart script and general setup for Debian based distro

0 commentaires:

Enregistrer un commentaire