#!/bin/sh # # mongodb Startup script for the mongodb _config_ server # # chkconfig: - 64 36 # description: MongoDB Database Configuration Server # processname: mongodb #Source function library . /etc/rc.d/init.d/functions start(){ echo -n $"Starting mongodb....:)" daemon --user=mongod /usr/bin/mongod "--configsvr -dbpath /data/configdb --port 27019" } stop(){ echo -n $"Stopping mongodb.....:(" /usr/bin/mongod --shutdown --dbpath /data/configdb } restart(){ /usr/bin/mongod --shutdown --dbpath /data/configdb daemon --user=mongod /usr/bin/mongod "--configsvr -dbpath /data/configdb --port 27019" } case "$1" in start) echo "Start service mongod" start ;; stop) echo "Stop service mongod" stop ;; restart) echo "Restart service mongod" restart ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac