2016-05-18 10:09:34 +02:00
|
|
|
#!/sbin/openrc-run
|
2015-08-21 14:55:40 +02:00
|
|
|
# Copyright 1999-2015 Gentoo Foundation
|
2013-05-11 05:06:56 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
2015-08-21 14:55:40 +02:00
|
|
|
# $Id$
|
|
|
|
|
|
|
|
name="TeamSpeak Server"
|
|
|
|
command="/usr/sbin/ts3server"
|
|
|
|
pidfile="/run/teamspeak3-server/server.pid"
|
|
|
|
command_background="true"
|
2013-05-11 05:06:56 +02:00
|
|
|
|
|
|
|
depend() {
|
|
|
|
need net
|
|
|
|
use mysql
|
|
|
|
}
|
|
|
|
|
2015-08-21 14:55:40 +02:00
|
|
|
start_pre() {
|
2013-05-11 05:06:56 +02:00
|
|
|
# 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
|
|
|
|
|
2013-09-06 17:11:54 +02:00
|
|
|
# temporay fix for EPERM bug (we still leave it here to make sure it is *really* not there)
|
|
|
|
rm -f /dev/shm/7gbhujb54g8z9hu43jre8
|
|
|
|
|
2015-08-21 14:55:40 +02:00
|
|
|
checkpath -d --owner teamspeak3:teamspeak3 --mode 0700 /run/teamspeak3-server
|
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
|
|
|
ebegin "Starting ${name}"
|
2013-09-06 17:11:54 +02:00
|
|
|
|
2013-05-11 05:06:56 +02:00
|
|
|
start-stop-daemon --start --quiet --background \
|
2015-08-21 14:55:40 +02:00
|
|
|
--pidfile "/run/teamspeak3-server/server.pid" --make-pidfile \
|
2013-05-11 05:06:56 +02:00
|
|
|
--user "teamspeak3" --chdir "/opt/teamspeak3-server" \
|
|
|
|
--exec "/usr/sbin/ts3server" -- \
|
|
|
|
inifile="/etc/teamspeak3-server/server.conf"
|
|
|
|
|
|
|
|
eend $?
|
|
|
|
}
|
|
|
|
|
|
|
|
restart() {
|
2015-08-21 14:55:40 +02:00
|
|
|
stop
|
2013-05-11 05:06:56 +02:00
|
|
|
sleep 3
|
2015-08-21 14:55:40 +02:00
|
|
|
start
|
2013-05-11 05:06:56 +02:00
|
|
|
}
|