Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

79 lines (70 sloc) 1.569 kb
#!/bin/bash
#
# mongod Startup script for the mongodb server
#
# chkconfig: - 64 36
# description: Mongod Server
#
# processname: mongod
#
# Source function library
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/mongodb ]; then
. /etc/sysconfig/mongodb
fi
prog="mongod"
mongod="/usr/local/mongo/bin/mongod"
MONGO_LOG="/var/log/mongos.log"
RETVAL=0
start() {
echo -n $"Starting $prog: "
daemon $mongod "-f /etc/mongo.conf 2>&1 >>$MONGO_LOG"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}
reload() {
echo -n $"Reloading $prog: "
killproc $prog -HUP
RETVAL=$?
echo
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/lock/subsys/$prog ]; then
stop
start
fi
;;
reload)
reload
;;
status)
status $mongod
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}"
RETVAL=1
esac
exit $RETVAL
Jump to Line
Something went wrong with that request. Please try again.