mongodb-control 839 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. # get wekan/mongo settings
  3. source $SNAP/bin/wekan-read-settings
  4. if [ "true" == "${DISABLE_MONGODB}" ]; then
  5. echo "mongodb is disabled. Not starting it"
  6. exit 0
  7. fi
  8. # make sure we have set minimum env variables for locale
  9. if [ -z "$LANG" ]; then
  10. export LANG=en_US.UTF-8
  11. fi
  12. export LC_ALL=C
  13. # start mongo deamon
  14. BIND_OPTIONS=""
  15. if [ "nill" != "$MONGODB_BIND_UNIX_SOCKET" ] && [ "x" != "x${MONGODB_BIND_UNIX_SOCKET}" ]; then
  16. BIND_OPTIONS+=" --unixSocketPrefix $MONGODB_BIND_UNIX_SOCKET"
  17. fi
  18. if [ "x" != "x${MONGODB_BIND_IP}" ]; then
  19. BIND_OPTIONS+=" --bind_ip $MONGODB_BIND_IP"
  20. fi
  21. if [ "x" != "x${MONGODB_PORT}" ]; then
  22. BIND_OPTIONS+=" --port $MONGODB_PORT"
  23. fi
  24. echo "mongodb bind options: $BIND_OPTIONS"
  25. mongod --dbpath $SNAP_COMMON --logpath $SNAP_COMMON/mongodb.log --logappend --journal $BIND_OPTIONS