2016-05-18 10:09:34 +02:00
|
|
|
#!/sbin/openrc-run
|
2018-04-22 01:40:52 +02:00
|
|
|
# Copyright 1999-2018 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
|
|
|
|
2018-04-22 01:40:52 +02:00
|
|
|
command="/opt/bin/ts3server"
|
|
|
|
command_background="true"
|
|
|
|
group="teamspeak"
|
|
|
|
inifile="/etc/teamspeak3-server/ts3server.ini"
|
2015-08-21 14:55:40 +02:00
|
|
|
name="TeamSpeak Server"
|
|
|
|
pidfile="/run/teamspeak3-server/server.pid"
|
2018-04-22 01:40:52 +02:00
|
|
|
user="teamspeak"
|
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
|
|
|
|
|
2018-04-22 01:40:52 +02:00
|
|
|
checkpath -d --owner ${user}:${group} --mode 0700 /run/teamspeak3-server
|
2015-08-21 14:55:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
|
|
|
ebegin "Starting ${name}"
|
2013-09-06 17:11:54 +02:00
|
|
|
|
2018-04-22 01:40:52 +02:00
|
|
|
start-stop-daemon --start --quiet --background --env "TS3SERVER_LICENSE=accept" \
|
|
|
|
--pidfile "${pidfile}" --make-pidfile \
|
|
|
|
--user "${user}" --group "${group}" --chdir "/opt/teamspeak3-server" \
|
|
|
|
--exec "${command}" -- \
|
|
|
|
inifile="${inifile}"
|
2013-05-11 05:06:56 +02:00
|
|
|
|
|
|
|
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
|
|
|
}
|