Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

76 lines (59 sloc) 1.23 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"
SYSCONFIG="/etc/sysconfig/mongod"
mongod=${MONGOD-/usr/bin/mongod}
MONGO_USER=mongod
MONGO_GROUP=mongod
. "$SYSCONFIG" || true
start()
{
echo -n $"Starting mongod: "
daemon --user "$MONGO_USER" $mongod $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/mongod
}
stop()
{
echo -n $"Stopping mongod: "
killproc -p /var/lib/mongo/mongod.lock -t30 -TERM /usr/bin/mongod
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/mongod
}
restart () {
stop
start
}
ulimit -n 12000
RETVAL=0
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload|force-reload)
restart
;;
condrestart)
[ -f /var/lock/subsys/mongod ] && restart || :
;;
status)
status $mongod
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
RETVAL=1
esac
exit $RETVAL
Jump to Line
Something went wrong with that request. Please try again.