mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2025-01-24 22:01:49 +01:00
Create systemd-copypasta
This commit is contained in:
parent
1d05aac9bc
commit
be050c3215
30
systemd-copypasta
Normal file
30
systemd-copypasta
Normal file
@ -0,0 +1,30 @@
|
||||
# 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
|
||||
|
||||
ExecStart=/usr/bin/screen -DmS mc-%i /bin/sh start.sh
|
||||
ExecReload=/usr/bin/screen -p 0 -S mc-%i -X eval 'stuff "viaver reload"\\015'
|
||||
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 "viaaas end"\\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'
|
||||
ExecStop=/bin/sh -c 'sleep 10'
|
||||
|
||||
Restart=on-failure
|
||||
RestartSec=60s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user