Ajouter files/minecraft.service
Some checks failed
Run ansible / run-ansible-playbook (push) Failing after 55s

This commit is contained in:
2025-08-22 10:11:59 +02:00
parent 1c94d65e12
commit 7cbb5903d9

26
files/minecraft.service Normal file
View File

@@ -0,0 +1,26 @@
[Unit]
Description=Minecraft Server
Wants=network.target
After=network.target
[Service]
User=minecraft
Group=minecraft
UMask=0027
Nice=1
KillMode=none
SuccessExitStatus=0 1 255
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