#! /bin/sh
#
# tss2serverd is an init script for Team Speak 2 Server running under chroot on RedHat 9
#
# Based on debian version written by Alexander Skwar <[email protected]>
#
# chkconfig: 345 93 20
# description: Starts and stops the Team Speak 2 server in a chroot environment.
# processname: server_linux
#
# To run the teamspeak server in a chroot jail you need to do the following:
#
# 1. Install tss2 server into a directory, for instance /home/teamspeak
#
# 2. You need to prepare /home/teamspeak to allow operation as a chroot directory:
# In /home/teamspeak create the following directories:
# * etc
# * dev
# * lib
# * tmp
# * usr
# * usr/lib
# * usr/lib/gconv
# * usr/lib/locale
# * var
# * var/run
#
# 3. Copy the following files into the corresponding directories you created above:
#
# * /etc/group
# * /etc/ld.so.conf
# * /etc/localtime
# * /etc/passwd
# * /lib/ld-linux.so.2
# * /lib/libc.so.6
# * /lib/libdl.so.2
# * /lib/libncurses.so.5
# * /lib/libpthread.so.0
# * /usr/lib/gconv/ISO8859-15.so
# * /usr/lib/gconv/gconv-modules
# * /usr/lib/locale/locale-archive
#
# 4. TSS2 needs /dev/null, which has to be created in /home/teamspeak.
# As root, change into the dev directory in /home/teamspeak and do:
#
# mknod null c 1 3
# chmod 0666 null
#
# 5. Create a user and group teamspeak, with login shell /bin/false
#
# 6. In /home/teamspeak, setup server_linux to run as teamspeak user
#
# chown teamspeak.teamspeak server_linux
# chmod 6770 server_linux
#
# 7. Place this file (i.e. tss2serverd) in /etc/rc.d/init.d
#
# cp tss2serverd.txt /etc/rc.d/init.d/tss2serverd
#
# 8. Run the following command:
#
# chkconfig --add tss2serverd
#
# 9. Use RH9 "services configuration" GUI to manage
#
#Source function library.
. /etc/init.d/functions
# CHANGE NEXT 3 LINES TO MATCH YOUR CONFIG
CHROOT_DIR=/home/teamspeak
EXEC=/server_linux
PID=/home/teamspeak/server.pid