VIAaaS/systemd-copypasta.txt

28 lines
695 B
Plaintext
Raw Permalink Normal View History

2021-03-28 13:22:15 +02:00
# modified https://minecraft.fandom.com/wiki/Tutorials/Server_startup_script#Installation
[Unit]
Description=Minecraft Server %i
After=network.target
[Service]
WorkingDirectory=/opt/minecraft/%i
User=minecraft
Group=minecraft
PrivateUsers=true
ProtectSystem=full
ProtectHome=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
2021-07-28 16:49:54 +02:00
LimitMEMLOCK=64M
2021-03-28 13:22:15 +02:00
ExecStart=/usr/bin/screen -DmS mc-%i /bin/sh start.sh
ExecReload=/usr/bin/screen -p 0 -S mc-%i -X eval 'stuff "reload"\\015'
ExecStop=/usr/bin/screen -p 0 -S mc-%i -X eval 'stuff "end"\\015'
ExecStop=/usr/bin/screen -p 0 -S mc-%i -X eval 'stuff "stop"\\015'
Restart=on-failure
[Install]
WantedBy=multi-user.target