diff options
Diffstat (limited to 'media-sound/teamspeak-server-bin/files/teamspeak-server-bin-init-r1')
-rw-r--r-- | media-sound/teamspeak-server-bin/files/teamspeak-server-bin-init-r1 | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/media-sound/teamspeak-server-bin/files/teamspeak-server-bin-init-r1 b/media-sound/teamspeak-server-bin/files/teamspeak-server-bin-init-r1 new file mode 100644 index 000000000000..170c811f9293 --- /dev/null +++ b/media-sound/teamspeak-server-bin/files/teamspeak-server-bin-init-r1 @@ -0,0 +1,43 @@ +#!/sbin/runscript +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-sound/teamspeak-server-bin/files/teamspeak-server-bin-init-r1,v 1.1 2015/08/02 13:00:19 jlec Exp $ + +name="TeamSpeak Server" +command="/usr/sbin/ts3server" +pidfile="/run/teamspeak3-server/server.pid" +command_background="true" + +depend() { + need net + use mysql +} + +start_pre() { + # ensure, that the TS3-server finds all custom supplied shared objects on startup. + LD_LIBRARY_PATH="/opt/teamspeak3-server:$LD_LIBRARY_PATH" + export LD_LIBRARY_PATH + + # temporay fix for EPERM bug (we still leave it here to make sure it is *really* not there) + rm -f /dev/shm/7gbhujb54g8z9hu43jre8 + + checkpath -d --owner teamspeak3:teamspeak3 --mode 0700 /run/teamspeak3-server +} + +start() { + ebegin "Starting ${name}" + + start-stop-daemon --start --quiet --background \ + --pidfile "/run/teamspeak3-server/server.pid" --make-pidfile \ + --user "teamspeak3" --chdir "/opt/teamspeak3-server" \ + --exec "/usr/sbin/ts3server" -- \ + inifile="/etc/teamspeak3-server/server.conf" + + eend $? +} + +restart() { + stop + sleep 3 + start +} |