mirror of
https://github.com/msfjarvis/server-config
synced 2025-08-17 01:16:59 +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
|
Loading…
Add table
Add a link
Reference in a new issue