Spaces:
Sleeping
Sleeping
Update start.sh
Browse files
start.sh
CHANGED
@@ -4,6 +4,12 @@ set -x -e
|
|
4 |
echo "Creating data directory..."
|
5 |
mkdir -p /data/db
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
echo "Starting MongoDB..."
|
8 |
mongod --config /etc/mongod.conf &
|
9 |
|
|
|
4 |
echo "Creating data directory..."
|
5 |
mkdir -p /data/db
|
6 |
|
7 |
+
echo "Cleaning up any stale lock files..."
|
8 |
+
rm -f /data/db/mongod.lock
|
9 |
+
|
10 |
+
echo "Ensuring no MongoDB process is running..."
|
11 |
+
pkill mongod || true # 'true' ensures script continues if no process found
|
12 |
+
|
13 |
echo "Starting MongoDB..."
|
14 |
mongod --config /etc/mongod.conf &
|
15 |
|