Add systemd/minecraft.service

This commit is contained in:
TED A. ⭕ 2023-11-06 23:03:22 +00:00
parent c84da8f48c
commit 4583828c90
1 changed files with 25 additions and 0 deletions

25
systemd/minecraft.service Normal file
View File

@ -0,0 +1,25 @@
[Unit]
Description=Minecraft Server
Documentation=
Wants-network.target
After=network.target
[Service]
User=minecraft
Group=minecraft
Nice=5
KillMode=none
Success ExitStatus=0 1
ProtectHome=true
ProtectSystem=full
PrivateDevices=true
NoNewPrivileges=true
PrivateTmp=true
InaccessibleDirectories=/root /sys/srv -/opt/media -/lost+found
ReadWriteDirectories=/mt/sdb/mc
Working Directory=/mt/sdb/mc
ExecStart=java -Xmx7000M -Xms7000M -jar server.jar nogui
ExecStop=/mt/sdb/mc/mcrcon/mcrcon - H localhost -P 25575 -p TOKEN TOKEN stop
[Install]
WantedBy-multi-user.target