MongoDB的服务配置文件
#!/bin/bash# Provides: mongod
# chkconfig: - 60 50
# processname: mongod
# config: /etc/mongod/mongod.conf
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
RETVAL=0
prog="mongod"
start() {
# Start daemons.
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 1
[ -x /mongodb/opt/mondb/bin/mongod ] || exit 1
echo -n $"start up $prog: "
daemon /mongodb/opt/mondb/bin/mongod -f /mongodb/opt/mondb/config/mongdb.cnf
RETVAL=$?
if [ $RETVAL -eq 0 ]
then
echo ""
echo ""
else
echo "Failed"
echo ""
fi
return $RETVAL
}
stop() {
# Stop daemons.
echo -n $"Shutting down $prog: "
killproc $prog
RETVAL=$?
echo
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
exit 1
esac
exit $RETVAL
页:
[1]