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.
 
 

77 lines
1.3 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/bigcouch/kazoo-bigcouch.pid
#
RETVAL=0
PID_FILE=${PID_FILE:-/var/run/bigcouch/kazoo-bigcouch.pid}
LOCK_FILE=${LOCK_FILE:-/var/lock/subsys/kazoo-bigcouch}
. /etc/init.d/functions
start() {
echo -n $"Starting BigCouch: "
/usr/sbin/kazoo-bigcouch prepare >/dev/null 2>&1
daemon --pidfile ${PID_FILE} "/usr/sbin/kazoo-bigcouch background >/dev/null 2>&1"
RETVAL=$?
if [ ${RETVAL} -eq 0 ]; then
touch ${LOCK_FILE}
success $"OK"
echo
else
failure $"Bigcouch is already running or failed to start!"
echo
fi
}
stop() {
echo -n $"Stopping BigCouch: "
/usr/sbin/kazoo-bigcouch stop >/dev/null 2>&1
RETVAL=$?
if [ ${RETVAL} -eq 0 ]; then
rm -f ${LOCK_FILE} ${pidfile}
success $"OK"
echo
else
failure $"Bigcouch is still running!"
echo
fi
}
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}