Skip to content

Commit 0619ab4

Browse files
Copilotlirantal
andcommitted
Fix FreeRADIUS Docker initialization issue by removing lock file on container start
Co-authored-by: lirantal <316371+lirantal@users.noreply.github.com>
1 parent d88337e commit 0619ab4

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

init-freeradius.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,20 @@ function init_database {
6666

6767
echo "Starting freeradius..."
6868

69+
# Remove the lock file to ensure initialization runs on every container start
70+
# This prevents issues when containers are recreated but volumes persist
71+
INIT_LOCK=/data/.freeradius_init_done
72+
if test -f "$INIT_LOCK"; then
73+
echo "Removing existing lock file to ensure proper initialization on container restart."
74+
rm -f "$INIT_LOCK"
75+
fi
76+
6977
# wait for MySQL-Server to be ready
7078
while ! mysqladmin ping -h"$MYSQL_HOST" --silent; do
7179
echo "Waiting for mysql ($MYSQL_HOST)..."
7280
sleep 20
7381
done
7482

75-
INIT_LOCK=/data/.freeradius_init_done
7683
if test -f "$INIT_LOCK"; then
7784
echo "Init lock file exists, skipping initial setup."
7885
else

0 commit comments

Comments
 (0)