From 67d04ea4e22e66df0dfd36a0ecf6ad2c2a929e0c Mon Sep 17 00:00:00 2001 From: Miguel De Anda Date: Sun, 6 Mar 2011 00:22:57 -0300 Subject: system/mongodb: Added (Database Software) Signed-off-by: Niels Horn --- system/mongodb/rc.mongodb | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 system/mongodb/rc.mongodb (limited to 'system/mongodb/rc.mongodb') 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 + -- cgit v1.2.3