You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

80 lines
1.1 KiB

#!/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