Created
April 17, 2022 08:46
-
-
Save pnxl/8e0709f20378251de0496f74435258d2 to your computer and use it in GitHub Desktop.
minecraft server as a service unit
This file contains hidden or 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 running under [ADDRESS]. | |
[Service] | |
WorkingDirectory=[PATH TO SERVER DIR] | |
ExecStart=/usr/bin/java -jar -Xmx3G [PATH TO SERVER JAR] | |
ExecStop=/bin/kill -s SIGINT -$MAINPID & /bin/kill -s SIGINT -$MAINPID | |
Restart=always | |
RestartSec=10 | |
StandardOutput=syslog | |
StandardError=syslog | |
SyslogIdentifier=minecraft | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment