Minecraft-Server-Tools/minecraft@.service

20 lines
413 B
INI

[Unit]
Description=Minecraft Server: %i
After=network.target
[Service]
WorkingDirectory=/var/minecraft/instances/%i
User=minecraft
Group=minecraft
Restart=no
ExecStart=/usr/bin/screen -DmS minecraft-%i ./start_server.sh
ExecStop=/usr/bin/screen -p 0 -S minecraft-%i -X eval 'stuff "save-all"\015'
ExecStop=/usr/bin/screen -p 0 -S minecraft-%i -X eval 'stuff "stop"\015'
[Install]
WantedBy=multi-user.target