summaryrefslogtreecommitdiff
path: root/system/mongodb
diff options
context:
space:
mode:
authorMiguel De Anda <miguel@thedeanda.com>2014-07-05 07:58:12 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-07-05 07:58:12 +0700
commitb46b769505f16dd3cc1cf730a96c9dc8da2a0f01 (patch)
tree8b1da35a53a6950e11370e1725ede9b1a6e682f9 /system/mongodb
parent3f7c0a401fcfa3e7e8daa0a6e33a03193965d8a0 (diff)
downloadslackbuilds-b46b769505f16dd3cc1cf730a96c9dc8da2a0f01.tar.gz
system/mongodb: Updated for version 2.6.3.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/mongodb')
-rw-r--r--system/mongodb/README15
-rw-r--r--system/mongodb/doinst.sh1
-rw-r--r--system/mongodb/mongodb.SlackBuild34
-rw-r--r--system/mongodb/mongodb.info10
-rw-r--r--system/mongodb/rc.mongodb12
5 files changed, 59 insertions, 13 deletions
diff --git a/system/mongodb/README b/system/mongodb/README
index 8ab7036278..01e9a73c0d 100644
--- a/system/mongodb/README
+++ b/system/mongodb/README
@@ -1,2 +1,13 @@
-MongoDB is a scalable, high-performance, open source document-oriented
-database.
+MongoDB is a scalable, high-performance, open source document-oriented database.
+
+You'll need to create a mongo user and group in order to run mongo with the provided init script:
+
+# groupadd -g 285 mongo
+# useradd -u 285 -d /var/lib/mongodb -s /bin/false -g mongo mongo
+
+
+You'll also need to add the following to /etc/rc.d/rc.local
+
+if [ -x /etc/rc.d/rc.mongodb ]; then
+ /etc/rc.d/rc.mongodb start
+fi
diff --git a/system/mongodb/doinst.sh b/system/mongodb/doinst.sh
index d68b4fc8e8..43120b22ae 100644
--- a/system/mongodb/doinst.sh
+++ b/system/mongodb/doinst.sh
@@ -23,4 +23,3 @@ preserve_perms() {
}
preserve_perms etc/rc.d/rc.mongodb.new
-
diff --git a/system/mongodb/mongodb.SlackBuild b/system/mongodb/mongodb.SlackBuild
index 346b0da531..7d0fa83b51 100644
--- a/system/mongodb/mongodb.SlackBuild
+++ b/system/mongodb/mongodb.SlackBuild
@@ -4,7 +4,7 @@
# Home Page http://www.mongodb.org
PRGNAM="mongodb"
-VERSION=${VERSION:-2.6.1}
+VERSION=${VERSION:-2.6.3}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -21,8 +21,35 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
+MONGO_USER=${MONGO_USER:-285}
+MONGO_GROUP=${MONGO_GROUP:-285}
+
set -e
+# Bail if user or group isn't valid on your system
+if ! getent passwd mongo 1>/dev/null 2>/dev/null; then
+
+cat << EOF
+
+ You must have a mongo user to run this script
+
+ # groupadd -g $MONGO_USER mongo
+ # useradd -u $MONGO_USER -d /var/lib/$PRGNAM -s /bin/false -g mongo mongo
+
+EOF
+
+ exit
+elif ! getent group mongo 1>/dev/null 2>/dev/null; then
+
+cat << EOF
+
+ You must have a mongo group to run this script
+ # groupadd -g $MONGO_GROUP mongo
+
+EOF
+ exit
+fi
+
rm -fr $TMP/$PRGNAM-$VERSION $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
@@ -33,7 +60,7 @@ find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
mkdir -p ${PKG}/usr/doc/${PRGNAM}-${VERSION}
cp GNU-AGPL-3.0 README THIRD-PARTY-NOTICES ${PKG}/usr/doc/${PRGNAM}-${VERSION}
@@ -47,5 +74,8 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
+mkdir -p $PKG/var/lib/mongodb
+chown mongo.mongo $PKG/var/lib/mongodb
+
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/system/mongodb/mongodb.info b/system/mongodb/mongodb.info
index 90ff5bf0ee..42ca5910fd 100644
--- a/system/mongodb/mongodb.info
+++ b/system/mongodb/mongodb.info
@@ -1,10 +1,10 @@
PRGNAM="mongodb"
-VERSION="2.6.1"
+VERSION="2.6.3"
HOMEPAGE="http://www.mongodb.org/"
-DOWNLOAD="https://fastdl.mongodb.org/linux/mongodb-linux-i686-2.6.1.tgz"
-MD5SUM="fb3c5fb843344c0a94f8de667f373629"
-DOWNLOAD_x86_64="https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.1.tgz"
-MD5SUM_x86_64="d3e5505d95c67ba52206960995655ec7"
+DOWNLOAD="https://fastdl.mongodb.org/linux/mongodb-linux-i686-2.6.3.tgz"
+MD5SUM="a82ff1787472399178589df5d8d45c81"
+DOWNLOAD_x86_64="https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.3.tgz"
+MD5SUM_x86_64="9b3db9b6d889e6bc0d6e3bfe4316a85a"
REQUIRES=""
MAINTAINER="Miguel De Anda"
EMAIL="miguel@thedeanda.com"
diff --git a/system/mongodb/rc.mongodb b/system/mongodb/rc.mongodb
index d4771ecd1a..f00cc685c4 100644
--- a/system/mongodb/rc.mongodb
+++ b/system/mongodb/rc.mongodb
@@ -9,20 +9,26 @@
PID=/var/state/mongodb.pid
LOG=/var/log/mongodb
DBPATH=/var/lib/mongodb
+USER=mongo
+GROUP=mongo
mongo_start() {
- mkdir -p $DBPATH
- /usr/bin/mongod \
+ touch $LOG
+ chown $GROUP.$USER $LOG
+ touch $PID
+ chown $GROUP.$USER $PID
+ sudo -u $USER /usr/bin/mongod \
--dbpath=$DBPATH \
--fork \
--pidfilepath=$PID \
+ --logappend \
--logpath=$LOG \
--nohttpinterface
}
mongo_stop() {
kill `cat $PID`
- rm $PID
+ # rm $PID
}
mongo_restart() {