#!/bin/sh# #mongod - Startup script for mongod## chkconfig: - 85 15# description: mongodb database.# processname: mongod# source function library . /etc/rc.d/init.d/functions# things from mongod.conf get There by mongod reading it# optionsoptions= " --dbpath=/home/data/mongodb/ - -logpath=/home/data/mongodb/mongodb.log --logappend & "#mongodmongod ="/usr/local/mongodb/bin/ Mongod "Lockfile=/var/lock/subsys/mongodstart () { echo -n $" starting mongod: " daemon $mongod $OPTIONS RETVAL=$? echo [ $RETVAL -eq 0 ] && touch $lockfile} stop () { echo -n $ "stopping mongod: " killproc $mongod -quit retval=$? echo [ $RETVAL -eq 0 ] && rm -f $lockfile} restart () { stop start}ulimit -n 12000RETVAL=0 case "$" in start) start ;; stop) stop ;; restart|reload|force-reload) restart ;; condrestart) [ -f $lockfile ] && restart | | : ;; status) status $mongod RETVAL=$? ;; *) echo "usage: $0 {start|stop|status|restart|reload| Force-reload|condrestart} " RETVAL=1esacexit $RETVAL
/etc/init.d/mongodb
This article is from the "lake and Laughter" blog, please make sure to keep this source http://hashlinux.blog.51cto.com/9647696/1788489
MongoDB Service startup script