nixos/mongodb: fix initialScript when dbpath exists and is empty

This commit is contained in:
Lucie
2025-09-14 22:43:57 +02:00
parent ed9b583096
commit 51c3144112
@@ -164,6 +164,8 @@ in
rm ${cfg.dbpath}/mongod.lock || true
if ! test -e ${cfg.dbpath}; then
install -d -m0700 -o ${cfg.user} ${cfg.dbpath}
fi
if ! test -e ${cfg.dbpath}/storage.bson; then
# See postStart!
touch ${cfg.dbpath}/.first_startup
fi