mirror of
https://github.com/msfjarvis/server-config
synced 2025-08-16 15:57:00 +05:30
systemd: add minecraft
This commit is contained in:
parent
b8b9366555
commit
954a89b610
2 changed files with 32 additions and 1 deletions
31
systemd_units/minecraft-server.service
Normal file
31
systemd_units/minecraft-server.service
Normal 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
|
|
@ -8,7 +8,7 @@ function prettyPrint() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Grab all service names
|
# 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
|
# Now loop through each service and install it
|
||||||
for service in "${services[@]}"; do
|
for service in "${services[@]}"; do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue