systemd: add minecraft

This commit is contained in:
Harsh Shandilya 2022-12-22 13:46:55 +05:30
parent b8b9366555
commit 954a89b610
No known key found for this signature in database
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,31 @@
[Unit]
Description=Private Minecraft server
After=network.target
[Service]
Restart=on-abort
Type=simple
User=minecraft
WorkingDirectory=/opt/minecraft/server
ExecStartPre=/usr/bin/env bash update.sh
ExecStart=/usr/bin/env bash start.sh
ExecStop=/usr/bin/env bash stop.sh
KillMode=mixed
KillSignal=SIGQUIT
TimeoutStopSec=10s
# Security
PrivateTmp=true
ProtectSystem=full
NoNewPrivileges=true
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=true
PrivateDevices=true
RestrictAddressFamilies=AF_INET
RestrictNamespaces=true
RestrictRealtime=true
SystemCallArchitectures=native
[Install]
WantedBy=multi-user.target

View File

@ -8,7 +8,7 @@ function prettyPrint() {
}
# Grab all service names
declare -a services=('mirror-bot' 'uno-bot')
declare -a services=('minecraft-server' 'mirror-bot' 'uno-bot')
# Now loop through each service and install it
for service in "${services[@]}"; do