diff --git a/docs/misc/autopause-autostop/autopause.md b/docs/misc/autopause-autostop/autopause.md index e6b994f1..84d31272 100644 --- a/docs/misc/autopause-autostop/autopause.md +++ b/docs/misc/autopause-autostop/autopause.md @@ -38,6 +38,8 @@ The following environment variables define the behaviour of auto-pausing: describes period of the daemonized state machine, that handles the pausing of the process (resuming is done independently) - `AUTOPAUSE_KNOCK_INTERFACE`, default `eth0`
Describes the interface passed to the `knockd` daemon. If the default interface does not work, run the `ifconfig` command inside the container and derive the interface receiving the incoming connection from its output. The passed interface must exist inside the container. Using the loopback interface (`lo`) does likely not yield the desired results. +- `AUTOPAUSE_STATUS_RETRY_LIMIT`, default 10 +- `AUTOPAUSE_STATUS_RETRY_INTERVAL`, default 2s !!! tip diff --git a/docs/misc/autopause-autostop/autostop.md b/docs/misc/autopause-autostop/autostop.md index 88ed0c0f..e086fb39 100644 --- a/docs/misc/autopause-autostop/autostop.md +++ b/docs/misc/autopause-autostop/autostop.md @@ -17,12 +17,14 @@ Enable the Autostop functionality by setting: ``` The following environment variables define the behavior of auto-stopping: -* `AUTOSTOP_TIMEOUT_EST`, default `3600` (seconds) +- `AUTOSTOP_TIMEOUT_EST`, default `3600` (seconds) describes the time between the last client disconnect and the stopping of the server (read as timeout established) -* `AUTOSTOP_TIMEOUT_INIT`, default `1800` (seconds) +- `AUTOSTOP_TIMEOUT_INIT`, default `1800` (seconds) describes the time between server start and the stopping of the server, when no client connects in-between (read as timeout initialized) -* `AUTOSTOP_PERIOD`, default `10` (seconds) +- `AUTOSTOP_PERIOD`, default `10` (seconds) describes period of the daemonized state machine, that handles the stopping of the server +- `AUTOPAUSE_STATUS_RETRY_LIMIT`, default 10 +- `AUTOPAUSE_STATUS_RETRY_INTERVAL`, default 2s > To troubleshoot, add `DEBUG_AUTOSTOP=true` to see additional output diff --git a/examples/autopause/compose.yml b/examples/autopause/compose.yml index 4782f7cc..95c73c54 100644 --- a/examples/autopause/compose.yml +++ b/examples/autopause/compose.yml @@ -13,6 +13,7 @@ services: # More aggressive settings for demo purposes AUTOPAUSE_TIMEOUT_INIT: "30" AUTOPAUSE_TIMEOUT_EST: "10" + JVM_DD_OPTS: "disable.watchdog:true" restart: unless-stopped volumes: diff --git a/files/auto/autopause-fcns.sh b/files/auto/autopause-fcns.sh index 8824d47e..73ea4ba3 100644 --- a/files/auto/autopause-fcns.sh +++ b/files/auto/autopause-fcns.sh @@ -37,7 +37,12 @@ mc_server_listening() { java_clients_connections() { local connections if java_running; then - if ! connections=$(mc-monitor status $(use_proxy) --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" $(use_server_list_ping) --show-player-count); then + if ! connections=$(mc-monitor status \ + --host "${SERVER_HOST:-localhost}" \ + --port "$SERVER_PORT" \ + --retry-limit "${AUTOPAUSE_STATUS_RETRY_LIMIT:-10}" --retry-interval "${AUTOPAUSE_STATUS_RETRY_INTERVAL:-2s}" \ + $(use_proxy) $(use_server_list_ping) \ + --show-player-count); then # consider it a non-zero player count if the ping fails # otherwise a laggy server with players connected could get paused connections=1