Decommission EXEC_DIRECTLY (#3837)

This commit is contained in:
Marc
2025-12-27 22:29:28 +01:00
committed by GitHub
parent 308a7766fa
commit c45d3e2fdd
4 changed files with 6 additions and 31 deletions

View File

@@ -22,8 +22,6 @@ A `.skip-pause` file can be created in the `/data` directory to make the server
A starting, example compose file has been provided in [the examples](https://github.com/itzg/docker-minecraft-server/blob/master/examples/autopause/compose.yml).
Auto-pause is not compatible with `EXEC_DIRECTLY=true` and the two cannot be set together.
!!! note
When configuring kubernetes readiness/liveness health checks with auto-pause enabled, be sure to reference the `mc-health` wrapper script rather than `mc-status` directly.

View File

@@ -439,12 +439,6 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>EXEC_DIRECTLY</code></td>
<td>If you would like to docker attach to the Minecraft server console with color and interactive capabilities, then set to <code>true</code></td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>STOP_SERVER_ANNOUNCE_DELAY</code></td>
<td>To allow time for players to finish what they're doing during a graceful server shutdown, set <code>STOP_SERVER_ANNOUNCE_DELAY</code> to a number of seconds to delay after an announcement is posted by the server.</td>
@@ -645,10 +639,6 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
### Auto-Pause
!!! note
Autopause is not compatible with `EXEC_DIRECTLY=true` and the two cannot be set together.
<table>
<thead>
<tr>

View File

@@ -95,11 +95,6 @@ fi
##########################################
# Auto-pause/stop
if isTrue "${ENABLE_AUTOPAUSE}" && isTrue "${EXEC_DIRECTLY:-false}"; then
logError "EXEC_DIRECTLY=true is incompatible with ENABLE_AUTOPAUSE=true"
exit 1
fi
if isTrue "${ENABLE_AUTOPAUSE}" && isTrue "${ENABLE_AUTOSTOP}"; then
logError "ENABLE_AUTOPAUSE=true is incompatible with ENABLE_AUTOSTOP=true"
exit 1

View File

@@ -541,16 +541,12 @@ fi
if isTrue "${DEBUG_EXEC}"; then
set -x
fi
if isTrue "${EXEC_DIRECTLY:-false}"; then
"${finalArgs[@]}"
else
if [ -f "${FTB_DIR}/variables.txt" ]; then
JVM_ARGS="${JVM_XX_OPTS} ${JVM_OPTS} $expandedDOpts"
JVM_ARGS=${JVM_ARGS//$'\n'/}
sed -i "s~JAVA_ARGS=.*~JAVA_ARGS=\"${JVM_ARGS}\"~" "${FTB_DIR}/variables.txt"
fi
exec mc-server-runner "${mcServerRunnerArgs[@]}" "${finalArgs[@]}"
if [ -f "${FTB_DIR}/variables.txt" ]; then
JVM_ARGS="${JVM_XX_OPTS} ${JVM_OPTS} $expandedDOpts"
JVM_ARGS=${JVM_ARGS//$'\n'/}
sed -i "s~JAVA_ARGS=.*~JAVA_ARGS=\"${JVM_ARGS}\"~" "${FTB_DIR}/variables.txt"
fi
exec mc-server-runner "${mcServerRunnerArgs[@]}" "${finalArgs[@]}"
elif [[ $SERVER =~ run.sh ]]; then
log "Using Forge supplied run.sh script..."
echo $JVM_XX_OPTS $JVM_OPTS $expandedDOpts > user_jvm_args.txt
@@ -599,9 +595,5 @@ else
set -x
fi
if isTrue "${EXEC_DIRECTLY:-false}"; then
exec java "${finalArgs[@]}"
else
exec mc-server-runner ${bootstrapArgs} "${mcServerRunnerArgs[@]}" java "${finalArgs[@]}"
fi
exec mc-server-runner ${bootstrapArgs} "${mcServerRunnerArgs[@]}" java "${finalArgs[@]}"
fi