systemd: add minecraft
This commit is contained in:
parent
b8b9366555
commit
954a89b610
|
@ -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
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue