[Unit]
Description=Minecraft-JAVA Server
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/masa_to_minecraft/
User=root
Group=root
ProtectSystem=full
ProtectHome=true
ExecStart=/bin/sh -c '/usr/bin/screen -DmS minecraft /usr/bin/java -server -Xms2000M -Xmx2000M -XX:+UseG1GC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -jar /opt/minecraft/minecraft_server.1.19.3.jar nogui'
ExecReload=/usr/bin/screen -p 0 -S minecraft -X eval 'stuff "reload"\015'
ExecStop=/usr/bin/screen -p 0 -S minecraft -X eval 'stuff "save-all"\015'
ExecStop=/usr/bin/screen -p 0 -S minecraft -X eval 'stuff "stop"\015'
Restart=always
RestartSec=10s
[Install]
WantedBy=multi-user.target
コメント