mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Try to fix Snap MongoDB.
This commit is contained in:
parent
74a4b28313
commit
bb4fde6374
4 changed files with 36 additions and 18 deletions
|
|
@ -16,20 +16,28 @@ fi
|
|||
|
||||
export LC_ALL=C
|
||||
|
||||
# start mongo deamon
|
||||
BIND_OPTIONS=""
|
||||
if [ "nill" != "$MONGODB_BIND_UNIX_SOCKET" ] && [ "x" != "x${MONGODB_BIND_UNIX_SOCKET}" ]; then
|
||||
BIND_OPTIONS+=" --unixSocketPrefix $MONGODB_BIND_UNIX_SOCKET"
|
||||
fi
|
||||
if [ "x" != "x${MONGODB_BIND_IP}" ]; then
|
||||
BIND_OPTIONS+=" --bind_ip $MONGODB_BIND_IP"
|
||||
fi
|
||||
if [ "x" != "x${MONGODB_PORT}" ]; then
|
||||
BIND_OPTIONS+=" --port $MONGODB_PORT"
|
||||
fi
|
||||
echo "mongodb bind options: $BIND_OPTIONS"
|
||||
if [ -z "$MONGO_URL" ]; then
|
||||
|
||||
mongod --dbpath $SNAP_COMMON --logpath $SNAP_COMMON/mongodb.log --logappend --journal $BIND_OPTIONS --smallfiles
|
||||
# start mongo deamon
|
||||
BIND_OPTIONS=""
|
||||
if [ "nill" != "$MONGODB_BIND_UNIX_SOCKET" ] && [ "x" != "x${MONGODB_BIND_UNIX_SOCKET}" ]; then
|
||||
BIND_OPTIONS+=" --unixSocketPrefix $MONGODB_BIND_UNIX_SOCKET"
|
||||
fi
|
||||
if [ "x" != "x${MONGODB_BIND_IP}" ]; then
|
||||
BIND_OPTIONS+=" --bind_ip $MONGODB_BIND_IP"
|
||||
fi
|
||||
if [ "x" != "x${MONGODB_PORT}" ]; then
|
||||
BIND_OPTIONS+=" --port $MONGODB_PORT"
|
||||
fi
|
||||
echo "mongodb bind options: $BIND_OPTIONS"
|
||||
|
||||
mongod --dbpath $SNAP_COMMON --logpath $SNAP_COMMON/mongodb.log --logappend --journal $BIND_OPTIONS --smallfiles
|
||||
|
||||
else
|
||||
|
||||
mongod --dbpath $SNAP_COMMON --logpath $SNAP_COMMON/mongodb.log --logappend --journal $MONGO_URL --smallfiles
|
||||
|
||||
fi
|
||||
|
||||
# Drop indexes on database upgrade, when starting MongoDB
|
||||
mongo wekan --eval "db.getCollectionNames().forEach(function(col_name) { var coll = db.getCollection(col_name); coll.dropIndexes(); });" $BIND_OPTIONS
|
||||
#mongo wekan --eval "db.getCollectionNames().forEach(function(col_name) { var coll = db.getCollection(col_name); coll.dropIndexes(); });" $BIND_OPTIONS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue