minecraft/templates/minecraft.service.j2
changeset 19 31de177274a1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/minecraft/templates/minecraft.service.j2	Tue May 12 21:24:25 2020 -0500
@@ -0,0 +1,22 @@
+[Unit]
+Description=Minecraft Server
+Documentation=https://minecraft.gamepedia.com/Tutorials/Setting_up_a_server
+
+Wants=network.target
+After=network.target
+
+[Service]
+User={{minecraft_user}}
+Group={{minecraft_user}}
+WorkingDirectory={{minecraft_dir}}
+Restart=on-failure
+RestartSec=20 5
+ExecStart=/usr/bin/java -Xms1536M -Xmx1536M -jar server.jar nogui
+
+PrivateTmp=true
+ProtectSystem=full
+NoNewPrivileges=true
+PrivateDevices=true
+
+[Install]
+WantedBy=multi-user.target