Last active
February 26, 2016 03:18
-
-
Save adamsdesk/f4a38a3506fb69bc0d8f to your computer and use it in GitHub Desktop.
Minecraft Systemd service unit file. Used to run Minecraft server as a daemon and control it with mcrcon.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Minecraft Server | |
Wants=network.target | |
After=network.target | |
[Service] | |
User=minecraft | |
Group=minecraft | |
Nice=5 | |
SuccessExitStatus=0 1 143 255 | |
ProtectHome=true | |
ProtectSystem=full | |
PrivateDevices=true | |
NoNewPrivileges=true | |
PrivateTmp=true | |
InaccessibleDirectories=/root /sys /srv /mnt /media /lost+found | |
ReadWriteDirectories=/opt/minecraft/server | |
WorkingDirectory=/opt/minecraft/server | |
ExecStart=/usr/bin/java -Xmx1024M -Xms1024M -jar spigot.jar --noconsole | |
ExecStop=/opt/minecraft/mcrcon -H localhost -P port-number-here -p password-here stop | |
RestartSec=5s | |
Restart=always | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment