summaryrefslogtreecommitdiff
path: root/games-server/minecraft-server/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
commitd934827bf44b7cfcf6711964418148fa60877668 (patch)
tree0625f358789b5e015e49db139cc1dbc9be00428f /games-server/minecraft-server/files
parent2e34d110f164bf74d55fced27fe0000201b3eec5 (diff)
gentoo resync : 25.11.2020
Diffstat (limited to 'games-server/minecraft-server/files')
-rw-r--r--games-server/minecraft-server/files/README.gentoo20
-rw-r--r--games-server/minecraft-server/files/minecraft-server.confd7
-rw-r--r--games-server/minecraft-server/files/minecraft-server.initd-r347
-rw-r--r--games-server/minecraft-server/files/minecraft-server.service16
4 files changed, 16 insertions, 74 deletions
diff --git a/games-server/minecraft-server/files/README.gentoo b/games-server/minecraft-server/files/README.gentoo
deleted file mode 100644
index ae8c62a9cbf2..000000000000
--- a/games-server/minecraft-server/files/README.gentoo
+++ /dev/null
@@ -1,20 +0,0 @@
-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.confd b/games-server/minecraft-server/files/minecraft-server.confd
deleted file mode 100644
index 700498e5aead..000000000000
--- a/games-server/minecraft-server/files/minecraft-server.confd
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-# Java options for your started server
-# You should at least define some memory settings (-Xms, -Xmx),
-# for maximum memory, as the java default is far to low for Minecraft
-MINECRAFT_OPTS="-Xms1024m -Xmx1024m"
diff --git a/games-server/minecraft-server/files/minecraft-server.initd-r3 b/games-server/minecraft-server/files/minecraft-server.initd-r3
deleted file mode 100644
index a76d6d23e67f..000000000000
--- a/games-server/minecraft-server/files/minecraft-server.initd-r3
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-if [ "${SVCNAME}" = "minecraft-server" ]; then
- instance="main"
-else
- instance="${SVCNAME#minecraft-server.}"
-fi
-
-dtach_tmpfile="$(mktemp -u)"
-minecraft_command="/usr/bin/minecraft-server"
-minecraft_logs="/var/log/minecraft-server"
-minecraft_logs_instance="${minecraft_logs}/${instance}"
-minecraft_path="/var/lib/minecraft-server"
-minecraft_path_instance="${minecraft_path}/${instance}"
-name="Minecraft Server (World: ${instance})"
-pidfile="/run/minecraft-server.${instance}.pid"
-start_stop_daemon_args="--chdir ${minecraft_path_instance} --env JAVA_OPTS='${MINECRAFT_OPTS}'"
-
-command="/usr/bin/dtach"
-command_background="true"
-command_args="-N ${dtach_tmpfile} ${minecraft_command}"
-command_group="minecraft"
-command_user="minecraft"
-
-depend() {
- use net
-}
-
-start_pre() {
- checkpath -d -o "${command_user}:${command_group}" -q "${minecraft_path}" "${minecraft_path_instance}"
-
- checkpath -f -o "${command_user}:${command_group}" -q "${minecraft_path_instance}"/eula.txt
- echo "eula=true" > "${minecraft_path_instance}"/eula.txt
-
- checkpath -d -o "${command_user}:${command_group}" -q "${minecraft_logs}" "${minecraft_logs_instance}"
-
- if [ ! -L "${minecraft_path_instance}"/logs ]; then
- cd "${minecraft_path_instance}" && 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
-}
diff --git a/games-server/minecraft-server/files/minecraft-server.service b/games-server/minecraft-server/files/minecraft-server.service
new file mode 100644
index 000000000000..ad9167e5b1c9
--- /dev/null
+++ b/games-server/minecraft-server/files/minecraft-server.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Minecraft Server (World: %I)
+After=network.target
+
+[Service]
+User=minecraft
+Group=minecraft
+WorkingDirectory=-/var/lib/minecraft-server/%I
+PIDFile=/run/minecraft-server.%I.pid
+ExecStartPre=!/bin/mkdir -p /var/lib/minecraft-server/%I
+ExecStartPre=!/bin/chown -R minecraft:minecraft /var/lib/minecraft-server/%I
+ExecStartPre=/bin/sh -c 'echo "eula=true" > /var/lib/minecraft-server/%I/eula.txt'
+ExecStart=/bin/sh -c '/usr/bin/dtach -N $(mktemp -u) /usr/bin/minecraft-server'
+
+[Install]
+WantedBy=multi-user.target