Restart Script - TheBloom46/bloommanager-wiki GitHub Wiki

You're now able to use all of BloomManager's commands, but there's one potential problem. You want your servers created by BloomManager to passively update (without removing them and recreating them) to the newest version of their respective docker image. For this, BloomManager includes a jar you can run within a docker container to create another docker container in place of the outdated docker container.

Imagine you have a bedwars docker image and you want to update the plugins within gracefully. Well, you can have the restart script jar trigger when a bedwars match ends (/stop is run) from within the start.sh of the docker image. After /stop is run, the server will be removed from BloomManager as if you ran /servers remove, and a new server will be created with the same properties (sections, RAM amount, etc).

Note: This is incompatible with Option 1 of the example setup. You must use Option 2 for this functionality or make your own docker images.

Setup

Run the restart script jar(download here) to create a configuration directory.

In the configuration, fill in the fields to match that of the proxy's Redis database.

The Restart Script jar is meant to be run after a Minecraft server within the docker image shuts down. You must pass the name of the server that is being shut down and recreated as a startup argument of the jar.

Example from the example setup's startup scripts (for a Minecraft server, not a proxy) "start.sh":

#!/bin/bash

cd /home

java -Xms"$1"M -Xmx"$1"M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar paper-1.12.2.jar -server-port "$2"

echo "Sending Message"

java -jar RestartScript.jar "$3"
# $3 is the server name