Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: r1.2.3
Fetching contributors…

Cannot retrieve contributors at this time

64 lines (52 sloc) 1.128 kb
#!/bin/bash
# mongod - Startup script for mongod
# chkconfig: 35 85 15
# description: Mongo is a scalable, document-oriented database.
# processname: mongod
# config: /etc/mongod.conf
# pidfile: /var/run/mongo/mongo.pid
. /etc/rc.d/init.d/functions
# things from mongod.conf get there by mongod reading it
OPTIONS=" -f /etc/mongod.conf"
mongod=${MONGOD-/usr/bin/mongod}
pidfile=${PIDFILE-/var/run/mongod.pid}
lockfile=${LOCKFILE-/var/lock/subsys/mongod}
start()
{
echo -n $"Starting mongod: "
#daemon --pidfile=${pidfile} $mongod $OPTIONS > /var/log/mongod
$mongod $OPTIONS > /var/log/mongod 2>&1 &
RETVAL=$?
[ $RETVAL = 0 ] && touch ${lockfile}
echo OK
}
stop()
{
echo -n $"Stopping mongod: "
#killproc -p ${pidfile} -d 10 $mongod
#RETVAL=$?
killall mongod > /dev/null 2>&1
#[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
echo OK
}
ulimit -n 12000
RETVAL=0
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
# status)
# status -p ${pidfile} $mongod
# ;;
*)
echo $"Usage: $0 {start|stop|restart}"
RETVAL=1
esac
exit $RETVAL
Jump to Line
Something went wrong with that request. Please try again.