summaryrefslogtreecommitdiff
blob: fac26368a0439eddf7dbbbcdcbfccf3c4d26f999 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[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/ln -s /usr/share/minecraft-server/log4j2_112-116.xml /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