Added: STOP_SERVER_DELAY_COMMAND (#4109)

This commit is contained in:
James Wagner
2026-06-16 05:22:32 -07:00
committed by GitHub
parent 85170775fd
commit 0dce4ed863
3 changed files with 13 additions and 2 deletions
+3 -1
View File
@@ -50,6 +50,8 @@ If this behavior interferes with the log content, then disable TTY or remove the
To allow time for players to finish what they're doing during a graceful server shutdown, set `STOP_SERVER_ANNOUNCE_DELAY` to a number of seconds to delay after an announcement is posted by the server.
To set a custom command to run at the start of this delay period, set `STOP_SERVER_DELAY_COMMAND` to the full command. This will run in place of the announcement.
!!! warning "Increase stop grace period"
The Docker stop grace period must be increased to a value longer than the announce delay. The value to use that is longer than announce delay will vary based upon the amount of time it takes for final world data saving. If the container exits with exit code 137, then that indicates a longer grace period is needed.
@@ -242,4 +244,4 @@ To also include the timestamp with each log, set `LOG_TIMESTAMP` to "true". The
```
[init] 2022-02-05 16:58:33+00:00 Starting the Minecraft server...
```
```
+7 -1
View File
@@ -246,6 +246,12 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>STOP_SERVER_DELAY_COMMAND</code></td>
<td>To set a custom command to run at the start of this delay period, set <code>STOP_SERVER_DELAY_COMMAND</code> to the full command. This will run in place of the announcement.</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>PROXY</code></td>
<td>You may configure the use of an HTTP/HTTPS proxy by passing the proxy's URL</td>
@@ -670,4 +676,4 @@ This image maps known server properties as described in [this section](configura
<td></td>
<td><code></code></td>
<td>⬜️</td>
</tr> -->
</tr> -->
+3
View File
@@ -481,6 +481,9 @@ fi
if [[ ${STOP_SERVER_ANNOUNCE_DELAY} ]]; then
mcServerRunnerArgs+=(--stop-server-announce-delay "${STOP_SERVER_ANNOUNCE_DELAY}s")
fi
if [[ ${STOP_SERVER_DELAY_COMMAND} ]]; then
mcServerRunnerArgs+=(--stop-server-delay-command "${STOP_SERVER_DELAY_COMMAND}s")
fi
if isTrue "${ENABLE_SSH}"; then
mcServerRunnerArgs+=(--remote-console)
fi