summaryrefslogtreecommitdiffstats
path: root/system/mongodb/rc.mongodb
diff options
context:
space:
mode:
author Miguel De Anda2011-03-06 04:22:57 +0100
committer Niels Horn2011-03-06 04:22:57 +0100
commit67d04ea4e22e66df0dfd36a0ecf6ad2c2a929e0c (patch)
tree420413ef0eb41ea8daea848ebead83347d9cc4ed /system/mongodb/rc.mongodb
parent4a6ea94efa3c7a7231dacfb62b29e8de1cfc64a1 (diff)
downloadslackbuilds-67d04ea4e22e66df0dfd36a0ecf6ad2c2a929e0c.tar.gz
system/mongodb: Added (Database Software)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'system/mongodb/rc.mongodb')
-rw-r--r--system/mongodb/rc.mongodb49
1 files changed, 49 insertions, 0 deletions
diff --git a/system/mongodb/rc.mongodb b/system/mongodb/rc.mongodb
new file mode 100644
index 0000000000..d4771ecd1a
--- /dev/null
+++ b/system/mongodb/rc.mongodb
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# /etc/rc.d/rc.mongo
+#
+# Start/stop/restart the mongodb server.
+#
+#
+
+PID=/var/state/mongodb.pid
+LOG=/var/log/mongodb
+DBPATH=/var/lib/mongodb
+
+mongo_start() {
+ mkdir -p $DBPATH
+ /usr/bin/mongod \
+ --dbpath=$DBPATH \
+ --fork \
+ --pidfilepath=$PID \
+ --logpath=$LOG \
+ --nohttpinterface
+}
+
+mongo_stop() {
+ kill `cat $PID`
+ rm $PID
+}
+
+mongo_restart() {
+ mongo_stop
+ sleep 2
+ mongo_start
+}
+
+case "$1" in
+ 'start')
+ mongo_start
+ ;;
+ 'stop')
+ mongo_stop
+ ;;
+ 'restart')
+ mongo_restart
+ ;;
+ *)
+ # Default is "start", for backwards compatibility with previous
+ # Slackware versions. This may change to a 'usage' error someday.
+ mongo_start
+esac
+