- Change the rcon client target from 0.0.0.0 to 127.0.0.1 (cleaner semantics; 0.0.0.0 is for binding, not connecting). - Make container naming dynamic at ExecStop
27 lines
717 B
Text
27 lines
717 B
Text
[Unit]
|
|
Description=Modded Minecraft Server via Podman managed by Systemd
|
|
Documentation=https://git.nanody.de/anonoe/MMS
|
|
Wants=velocity.service
|
|
After=velocity.service
|
|
|
|
[Container]
|
|
Image=git.nanody.de/anonoe/jre-alpine:latest
|
|
AutoUpdate=registry
|
|
PublishPort=25566:25565/tcp
|
|
PublishPort=24455:24455/udp
|
|
UserNS=keep-id
|
|
Mount=type=bind,src=/PATH/TO/server,dst=/mnt/server
|
|
Mount=type=bind,src=/PATH/TO/rcon,dst=/mnt/rcon
|
|
WorkingDir=/mnt/server
|
|
PodmanArgs=--tty --interactive
|
|
Exec=java -Xmx4G -Xms1G -jar minecraft_server.jar --nogui
|
|
|
|
[Service]
|
|
SuccessExitStatus=0 143
|
|
TimeoutStartSec=480
|
|
TimeoutStopSec=480
|
|
ExecStop=-podman exec systemd-%N sh /mnt/rcon/stop.sh
|
|
|
|
[Install]
|
|
# Start by default on boot
|
|
WantedBy=default.target
|