fix rcon and intruduce systemd integration
This commit is contained in:
parent
a0d0c47b53
commit
0289aab9b0
4 changed files with 44 additions and 6 deletions
25
server/MMS.container
Normal file
25
server/MMS.container
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
[Unit]
|
||||
Description=Modded Minecraft Server via Podman managed by Systemd
|
||||
Documentation=https://git.nanody.de/anonoe/MMS
|
||||
|
||||
[Container]
|
||||
Image=git.nanody.de/anonoe/jre-alpine:latest
|
||||
AutoUpdate=registry
|
||||
PublishPort=25565:25565/tcp
|
||||
PublishPort=24454:24454/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-MMS sh /mnt/rcon/stop.sh
|
||||
|
||||
[Install]
|
||||
# Start by default on boot
|
||||
WantedBy=default.target
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
[MMS]
|
||||
hostname = 0.0.0.0
|
||||
port = 25565
|
||||
#password is redacted
|
||||
password =
|
||||
port = 25575
|
||||
password = PUT_PASSWORD_HERE_FROM_server.properties
|
||||
minecraft = true
|
||||
|
|
|
|||
|
|
@ -1 +1,15 @@
|
|||
rcon -c /mnt/rcon/rconrc -s MMS stop
|
||||
alias rc='rcon -c /mnt/rcon/rconrc -s MMS '
|
||||
rc 'tellraw @a ["",{"text":"!WARNING!","bold":true,"color":"red"}," The server will ",{"text":"shut down or restart","hoverEvent":{"action":"show_text","contents":"The state is unknown (like quantum physics)"}}," in",{"text":" 10","color":"dark_red"}," seconds..."]'
|
||||
sleep 5
|
||||
rc 'tellraw @a ["Stopping in"]'
|
||||
rc 'tellraw @a {"text":"5","color":"red"}'
|
||||
sleep 1
|
||||
rc 'tellraw @a {"text":"4","color":"red"}'
|
||||
sleep 1
|
||||
rc 'tellraw @a {"text":"3","color":"red"}'
|
||||
sleep 1
|
||||
rc 'tellraw @a {"text":"2","color":"dark_red"}'
|
||||
sleep 1
|
||||
rc 'tellraw @a ["",{"text":"!","obfuscated":true,"color":"dark_red"},{"text":" 1 ","color":"dark_red"},{"text":"!","obfuscated":true,"color":"dark_red"}]'
|
||||
sleep 1
|
||||
rc stop
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@ server-port=25565
|
|||
enable-jmx-monitoring=false
|
||||
enable-query=false
|
||||
query.port=25565
|
||||
enable-rcon=false
|
||||
enable-rcon=true
|
||||
rcon.port=25575
|
||||
#password is redacted
|
||||
# PUT A PASSWORD HERE
|
||||
rcon.password=
|
||||
use-native-transport=true
|
||||
network-compression-threshold=256
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue