Created
May 28, 2019 03:00
-
-
Save Pobega/a13a71bd0b02b9dcfd32da669adbc772 to your computer and use it in GitHub Desktop.
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
/etc/systemd/system/minecraft.service: | |
[Unit] | |
Description=Start Minecraft | |
After=network.target | |
[Service] | |
WorkingDirectory=/opt/minecraft/ | |
Type=simple | |
User=mc | |
Group=mc | |
ExecStart=/usr/bin/screen -DmS mc ./start.sh | |
ExecStop=/usr/bin/screen -p 0 -S mc -X eval 'stuff "save-all"\015' | |
ExecStop=/usr/bin/screen -p 0 -S mc -X eval 'stuff "stop"\015' | |
Restart=on-failure | |
RestartSec=60s | |
[Install] | |
WantedBy=default.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment