[Lunar-commits] <moonbase> mongodb: Switched to file based configuration.

Stefan Wold ratler at lunar-linux.org
Wed Mar 23 09:17:24 CET 2011


commit 586580469a53ace2187e0645865b51e35ee55a10
Author: Stefan Wold <ratler at lunar-linux.org>
Date:   Wed Mar 23 09:17:24 2011 +0100

    mongodb: Switched to file based configuration.
---
 sql/mongodb/BUILD            |    8 ++++----
 sql/mongodb/DETAILS          |    7 +++----
 sql/mongodb/config.d/mongodb |    8 --------
 sql/mongodb/init.d/mongodb   |   29 ++++-------------------------
 4 files changed, 11 insertions(+), 41 deletions(-)

diff --git a/sql/mongodb/BUILD b/sql/mongodb/BUILD
index 563f545..ddc77e1 100644
--- a/sql/mongodb/BUILD
+++ b/sql/mongodb/BUILD
@@ -1,13 +1,13 @@
 (
   add_priv_user mongodb:mongodb -d /var/lib/mongodb  &&
 
-  scons all &&
+  scons all --full &&
   prepare_install &&
-  scons --full --nostrip install --prefix=/usr &&
+  scons install --full --prefix=/usr &&
+
+  [ -f /etc/mongodb.conf ] || install -m 644 $SOURCE_CACHE/$SOURCE2 /etc/mongodb.conf &&
 
   for i in /var/{lib,log}/mongodb; do
     install -d $i -o mongodb -g mongodb -m 770
   done
-
-
 ) > $C_FIFO 2>&1
diff --git a/sql/mongodb/DETAILS b/sql/mongodb/DETAILS
index e4ccb12..a4b92b0 100644
--- a/sql/mongodb/DETAILS
+++ b/sql/mongodb/DETAILS
@@ -1,16 +1,15 @@
           MODULE=mongodb
          VERSION=r1.8.0
           SOURCE=$MODULE-src-$VERSION.tar.gz
+         SOURCE2=mongodb.conf-0.1
       SOURCE_URL=http://downloads.mongodb.org/src
      SOURCE2_URL=$PATCH_URL
-     SOURCE3_URL=$PATCH_URL
 SOURCE_DIRECTORY=$BUILD_DIRECTORY/$MODULE-src-$VERSION
       SOURCE_VFY=sha256:4c2992e49586d4b4a513937286fd8813f4cef44686e67275c4e96489e4456a96
-     SOURCE2_VFY=sha256:de26882ff9adcf46eb2227e185f7d880549333f0e87703cdf984cd1c4612ffd9
-     SOURCE3_VFY=sha256:84da5d6216a2b462420cf04fdb15c8fd7cb82222f50a33c5020679a04c514aa6
+     SOURCE2_VFY=sha256:ac7cab8b132b751d571b1185f8efb030197ddaf14f141facb08c33df0950801d
         WEB_SITE="http://www.mongodb.org/"
          ENTERED=20101205
-         UPDATED=20110321
+         UPDATED=20110323
            SHORT="A scalable, high-performance, key-value store, document-oriented database"
 cat << EOF
 MongoDB bridges the gap between key-value stores (which are fast and
diff --git a/sql/mongodb/config.d/mongodb b/sql/mongodb/config.d/mongodb
index e6b1722..7a9e6b6 100644
--- a/sql/mongodb/config.d/mongodb
+++ b/sql/mongodb/config.d/mongodb
@@ -2,11 +2,3 @@
 # MongoDB config.d
 #
 MDB_USER=mongodb
-MDB_DATADIR=/var/lib/mongodb
-MDB_BINDIP=127.0.0.1
-MDB_PORT=27017
-MDB_LOG=/var/log/mongodb/mongodb.log
-MDB_FORK="--fork"
-
-# Extra options
-MDB_OPTIONS=
diff --git a/sql/mongodb/init.d/mongodb b/sql/mongodb/init.d/mongodb
index 12f9410..47b9983 100644
--- a/sql/mongodb/init.d/mongodb
+++ b/sql/mongodb/init.d/mongodb
@@ -9,6 +9,9 @@
 
 # config settings
 [ -f /etc/config.d/mongodb ] && . /etc/config.d/mongodb
+
+# MongoDB config
+[ -f /etc/mongodb.conf ] || exit 1
 [ -x /usr/bin/mongod ] || exit 1
 
 ARGS=""
@@ -20,37 +23,13 @@ if [ -z "$MDB_USER" ] ; then
 	exit 1
 fi
 
-if [ -n "$MDB_BINDIP" ]; then
-  ARGS+=" --bind_ip $MDB_BINDIP"
-fi
-
-if [ -n "$MDB_PORT" ]; then
-  ARGS+=" --port $MDB_PORT"
-fi
-
-if [ -n "$MDB_DATADIR" ]; then
-  ARGS+=" --dbpath $MDB_DATADIR"
-fi
-
-if [ -n "$MDB_LOG" ]; then
-  ARGS+=" --logpath $MDB_LOG --logappend"
-fi
-
-if [ -n "$MDB_FORK" ]; then
-  ARGS+=" $MDB_FORK"
-fi
-
-if [ -n "$MDB_OPTIONS" ]; then
-  ARGS+=" $MDB_OPTIONS"
-fi
-
 start()
 {
   echo -n "Starting mongodb: "
   if [ -n "$MDBPID" ]; then
     echo "already running."
   else
-    su - $MDB_USER -c "/usr/bin/mongod $ARGS --pidfilepath /var/run/mongodb.pid &> /dev/null" &&
+    su - $MDB_USER -c "/usr/bin/mongod --config /etc/mongodb.conf --pidfilepath /var/run/mongodb.pid &> /dev/null" &&
     echo -e $RESULT_OK || echo -e $RESULT_FAIL
   fi
 }


More information about the Lunar-commits mailing list