Bug description
The warm restart detection in /etc/cont-init.d/0-container appears to contain a typo in the state directory path.
The script currently checks:
if [ -d /contaner/state ]; then
but the actual state directory used throughout the script is:
So the condition should presumably be:
if [ -d /container/state ]; then
Actual behavior
Because /contaner/state normally does not exist, the warm restart branch is never entered.
Instead, the script executes the else branch on every startup:
mkdir -p /container/state
echo "$(date +%s) $(date +'%Y-%m-%d %H:%M:%S %Z') - Container started" >> /container/state/startup
On my container, /container/state/startup consequently contains multiple Container started entries across restarts, for example:
1787320298 2026-08-21 13:51:38 GMT - Container started
1787320513 2026-08-21 15:55:13 CEST - Container started
1787390790 2026-08-22 11:26:30 CEST - Container started
Expected behavior
If /container/state already exists, the script should detect a warm restart and execute the corresponding cleanup/restart branch:
if [ -d /container/state ]; then
echo "Detected Container that has been restarted - Cleaning '/container/state' files"
...
echo "$(date +%s) $(date +'%Y-%m-%d %H:%M:%S %Z') - Warm restart detected" >> /container/state/restart
fi
Suggested fix
Change:
if [ -d /contaner/state ]; then
to:
if [ -d /container/state ]; then
Environment
The issue was observed in an Nfrastack-based FreeScout Docker container. The container uses /init as its entrypoint, which invokes /etc/cont-init.d/0-container.
The affected script identifies itself with:
SPDX-FileCopyrightText: © 2026 Nfrastack <code@nfrastack.com>
SPDX-License-Identifier: MIT
Note
Bug report text generated with help of ChatGPT
Bug description
The warm restart detection in
/etc/cont-init.d/0-containerappears to contain a typo in the state directory path.The script currently checks:
but the actual state directory used throughout the script is:
So the condition should presumably be:
Actual behavior
Because
/contaner/statenormally does not exist, the warm restart branch is never entered.Instead, the script executes the
elsebranch on every startup:On my container,
/container/state/startupconsequently contains multipleContainer startedentries across restarts, for example:Expected behavior
If
/container/statealready exists, the script should detect a warm restart and execute the corresponding cleanup/restart branch:Suggested fix
Change:
to:
Environment
The issue was observed in an Nfrastack-based FreeScout Docker container. The container uses
/initas its entrypoint, which invokes/etc/cont-init.d/0-container.The affected script identifies itself with:
Note
Bug report text generated with help of ChatGPT