From 8f1abc300d6315ec3785cf64e5fb8a914e4c4126 Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Thu, 18 Jul 2024 09:58:45 +0200 Subject: [PATCH] docker: make sure the sqlite db is present before changing GID (#3140) --- docker/docker_start.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/docker_start.sh b/docker/docker_start.sh index a3e9226bced..4db421e7c87 100755 --- a/docker/docker_start.sh +++ b/docker/docker_start.sh @@ -333,6 +333,8 @@ fi # crowdsec sqlite database permissions if [ "$GID" != "" ]; then if istrue "$(conf_get '.db_config.type == "sqlite"')"; then + # force the creation of the db file(s) + cscli machines inspect create-db --error >/dev/null 2>&1 || : # don't fail if the db is not there yet if chown -f ":$GID" "$(conf_get '.db_config.db_path')" 2>/dev/null; then echo "sqlite database permissions updated"