#!/bin/bash
|
|
#
|
|
# BigCouch
|
|
#
|
|
# chkconfig: 345 13 87
|
|
# description: BigCouch is a dynamo-style distributed database based on Apache CouchDB.
|
|
# processname: bigcouch
|
|
# pidfile: /var/run/kazoo-bigcouch.pid
|
|
#
|
|
|
|
RETVAL=0
|
|
LOCK_FILE=${LOCK_FILE:-/var/lock/subsys/kazoo-bigcouch}
|
|
|
|
. /etc/init.d/functions
|
|
|
|
if [ -f /etc/sysconfig/bigcouch ]; then
|
|
. /etc/sysconfig/bigcouch
|
|
fi
|
|
|
|
if [ "${NETWORKING}" = "no" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
[ -f /opt/bigcouch/bin/BigCouch ] || exit 0
|
|
|
|
start() {
|
|
RETVAL=1
|
|
echo -n $"Starting BigCouch: "
|
|
/usr/sbin/kazoo-bigcouch start
|
|
RETVAL=$?
|
|
echo
|
|
[ ${RETVAL} -eq 0 ] && touch ${LOCK_FILE}
|
|
}
|
|
|
|
stop() {
|
|
RETVAL=1
|
|
echo -n $"Stopping BigCouch: "
|
|
/usr/sbin/kazoo-bigcouch stop
|
|
RETVAL=$?
|
|
if [ ${RETVAL} -eq 0 ]; then
|
|
rm -f ${LOCK_FILE} ${pidfile}
|
|
success
|
|
else
|
|
failure
|
|
fi
|
|
echo
|
|
}
|
|
|
|
status() {
|
|
/usr/sbin/kazoo-bigcouch status
|
|
RETVAL=$?
|
|
}
|
|
|
|
restart() {
|
|
stop
|
|
start
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
status)
|
|
status
|
|
;;
|
|
restart|reload)
|
|
restart
|
|
;;
|
|
condrestart)
|
|
[ ! -e ${LOCK_FILE} ] && restart
|
|
;;
|
|
*)
|
|
echo $"Usage: $0 (start|stop|restart|status)"
|
|
RETVAL=1
|
|
esac
|
|
|
|
exit $RETVAL
|