games-server/minecraft-server: Forgottend systemd service
Package-Manager: Portage-3.0.8, Repoman-3.0.2 Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr>
This commit is contained in:
parent
c2ff910cb8
commit
eff3c443d6
16
games-server/minecraft-server/files/minecraft-server.service
Normal file
16
games-server/minecraft-server/files/minecraft-server.service
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Minecraft Server (World: %I)
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=minecraft
|
||||||
|
Group=minecraft
|
||||||
|
WorkingDirectory=-/var/lib/minecraft-server/%I
|
||||||
|
PIDFile=/run/minecraft-server.%I.pid
|
||||||
|
ExecStartPre=!/bin/mkdir -p /var/lib/minecraft-server/%I
|
||||||
|
ExecStartPre=!/bin/chown -R minecraft:minecraft /var/lib/minecraft-server/%I
|
||||||
|
ExecStartPre=/bin/sh -c 'echo "eula=true" > /var/lib/minecraft-server/%I/eula.txt'
|
||||||
|
ExecStart=/bin/sh -c '/usr/bin/dtach -N $(mktemp -u) /usr/bin/minecraft-server'
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in a new issue