diff options
author | Conrad Kostecki <conrad@kostecki.com> | 2018-07-30 16:05:28 +0200 |
---|---|---|
committer | Patrice Clement <monsieurp@gentoo.org> | 2018-08-05 23:47:31 +0200 |
commit | 27c7803e28b027c7adfbd598c2d4190b7a8d0329 (patch) | |
tree | 9857b756bad92af5c778f0e943fdad7fa6c9008c /games-server/minecraft-server/files | |
parent | net-misc/tigervnc: fix missing dependency. (diff) | |
download | gentoo-27c7803e28b027c7adfbd598c2d4190b7a8d0329.tar.gz gentoo-27c7803e28b027c7adfbd598c2d4190b7a8d0329.tar.bz2 gentoo-27c7803e28b027c7adfbd598c2d4190b7a8d0329.zip |
games-server/minecraft-server: version bump to 1.13.
Closes: https://bugs.gentoo.org/662434
Package-Manager: Portage-2.3.43, Repoman-2.3.10
Closes: https://github.com/gentoo/gentoo/pull/9382
Diffstat (limited to 'games-server/minecraft-server/files')
-rw-r--r-- | games-server/minecraft-server/files/README.gentoo | 20 | ||||
-rw-r--r-- | games-server/minecraft-server/files/minecraft-server-r1.initd | 47 |
2 files changed, 67 insertions, 0 deletions
diff --git a/games-server/minecraft-server/files/README.gentoo b/games-server/minecraft-server/files/README.gentoo new file mode 100644 index 000000000000..ae8c62a9cbf2 --- /dev/null +++ b/games-server/minecraft-server/files/README.gentoo @@ -0,0 +1,20 @@ +This package provides an init script and a conf file. +You don't have to modify those files directly, +but instead you can make a symlink of that init script +and a copy of that conf file. +You would do this for every server, you want to setup. + +For example, you wan't to setup an world called 'gentoo', +you would do: + +cd /etc/init.d +ln -s minecraft-server minecraft-server.gentoo + +cd /etc/conf.d +cp minecraft-server minecraft-server.gentoo + +After that, make your settings in +/etc/conf.d/minecraft-server.gentoo. + +If you don't make a symlink, but use the default scripts, +your world will be called 'main'. diff --git a/games-server/minecraft-server/files/minecraft-server-r1.initd b/games-server/minecraft-server/files/minecraft-server-r1.initd new file mode 100644 index 000000000000..872885ecd643 --- /dev/null +++ b/games-server/minecraft-server/files/minecraft-server-r1.initd @@ -0,0 +1,47 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +if [ "${SVCNAME}" = "minecraft-server" ]; then + instance="main" +else + instance="${SVCNAME#minecraft-server.}" +fi + +minecraft_command="/usr/bin/minecraft-server" +minecraft_logs="/var/log/minecraft-server" +minecraft_path="/var/lib/minecraft-server/${instance}" +name="Minecraft Server (World: ${instance})" +pidfile="/run/minecraft-server.${instance}.pid" +screen_name="minecraft-server.${instance}" +start_stop_daemon_args="--chdir ${minecraft_path} --env JAVA_OPTS=\"${MINECRAFT_OPTS}\"" + +command="screen" +command_args="-DmUS ${screen_name} ${minecraft_command}" +command_background="true" +command_group="minecraft" +command_user="minecraft" + +depend() { + use net +} + +start_pre() { + checkpath -d -o "${command_user}:${command_group}" -q "${minecraft_path}" + + checkpath -f -o "${command_user}:${command_group}" -q "${minecraft_path}"/eula.txt + echo "eula=true" > "${minecraft_path}"/eula.txt + + checkpath -d -o "${command_user}:${command_group}" -q "${minecraft_logs}"/"${instance}" + + if [ ! -L "${minecraft_path}"/logs ]; then + cd "${minecraft_path}" && ln -s ../../../log/minecraft-server/"${instance}" logs + fi + + if [ -z ${MINECRAFT_OPTS} ]; then + eerror "You must define MINECRAFT_OPTS in /etc/conf.d/minecraft.${SVCNAME}!" + return 1 + fi + + return 0 +} |