From c26043f9c66d2694ff7637812f8e01efc16c68f6 Mon Sep 17 00:00:00 2001 From: Hubert Cornet Date: Fri, 22 Aug 2025 19:20:22 +0200 Subject: [PATCH] =?UTF-8?q?T=C3=A9l=C3=A9verser=20les=20fichiers=20vers=20?= =?UTF-8?q?"roles/01-base-server/templates"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/minecraft.service | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 roles/01-base-server/templates/minecraft.service diff --git a/roles/01-base-server/templates/minecraft.service b/roles/01-base-server/templates/minecraft.service new file mode 100644 index 0000000..62a5ca9 --- /dev/null +++ b/roles/01-base-server/templates/minecraft.service @@ -0,0 +1,40 @@ +# [Service] +Environment=SHELL=/bin/bash +# Environment=TMUX_SESSION=minecraft +# Environment=TMUX_WINDOW=spigot +# Environment=JVM_OPTS="-server -XX:+UseConcMarkSweepGC -XX:MaxGCPauseMillis=50 -Xmx3G" +# WorkingDirectory={{ minecraft_home }} +# ExecStart=/bin/bash {{ minecraft_home }}/minecraft-server-start.sh +# ExecStop=/bin/bash {{ minecraft_home }}/minecraft-server-stop.sh + +[Install] +WantedBy=multi-user.target + +[Unit] +Description=Minecraft Server +Wants=network.target +After=network.target + +[Service] +User=minecraft +Group=minecraft +UMask=0027 + +Restart=on-failure +Type=forking +Nice=1 +KillMode=none +SuccessExitStatus=0 1 255 +StartLimitBurst=5 + +NoNewPrivileges=true +PrivateDevices=true +ProtectHome=true +ProtectSystem=full + +WorkingDirectory=/opt/minecraft/server +ExecStart=/usr/bin/java -Xmx2048M -Xms2048M -jar spigot-1.21.8.jar nogui +ExecStop=/opt/minecraft/tools/mcrcon/mcrcon -H 127.0.0.1 -P 25575 -p ${]Password} stop + +[Install] +WantedBy=multi-user.target \ No newline at end of file