feat: add unit

This commit is contained in:
Adam Douglas 2020-02-06 21:35:06 -06:00
parent d2177ddc6e
commit 97d58d1e63
3 changed files with 84 additions and 0 deletions

28
minecraft-paper.service Normal file
View File

@ -0,0 +1,28 @@
[Unit]
Description=Minecraft PaperMC Server
Wants=network.target
After=network.target
[Service]
Type=simple
User=minecraft
Group=minecraft
Nice=5
KillMode=none
ProtectHome=true
ProtectSystem=full
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=true
PrivateDevices=true
NoNewPrivileges=true
PrivateTmp=true
ReadWriteDirectories=/srv/minecraft/paper/server
WorkingDirectory=/srv/minecraft/paper/server
ExecStart=/usr/bin/java -Xmx2G -Xms2G -jar paper.jar --noconsole
ExecStop=/usr/local/bin/wardenctl directstop
RestartSec=5s
Restart=on-failure
[Install]
WantedBy=multi-user.target

28
minecraft-spigot.service Normal file
View File

@ -0,0 +1,28 @@
[Unit]
Description=Minecraft SpigotMC Server
Wants=network.target
After=network.target
[Service]
Type=simple
User=minecraft
Group=minecraft
Nice=5
KillMode=none
ProtectHome=true
ProtectSystem=full
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=true
PrivateDevices=true
NoNewPrivileges=true
PrivateTmp=true
ReadWriteDirectories=/srv/minecraft/spigot/server
WorkingDirectory=/srv/minecraft/spigot/server
ExecStart=/usr/bin/java -Xmx2G -Xms2G -jar spigot.jar --noconsole
ExecStop=/usr/local/bin/wardenctl directstop
RestartSec=5s
Restart=on-failure
[Install]
WantedBy=multi-user.target

28
minecraft-vanilla.service Normal file
View File

@ -0,0 +1,28 @@
[Unit]
Description=Minecraft Vanilla Server
Wants=network.target
After=network.target
[Service]
Type=simple
User=minecraft
Group=minecraft
Nice=5
KillMode=none
ProtectHome=true
ProtectSystem=full
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=true
PrivateDevices=true
NoNewPrivileges=true
PrivateTmp=true
ReadWriteDirectories=/srv/minecraft/vanilla/server
WorkingDirectory=/srv/minecraft/vanilla/server
ExecStart=/usr/bin/java -Xmx2G -Xms2G -jar vanilla.jar --noconsole
ExecStop=/usr/local/bin/wardenctl directstop
RestartSec=5s
Restart=on-failure
[Install]
WantedBy=multi-user.target