#! /bin/bash
#
# cachelogd          Start/Stop the mnogosearch indexing daemon.
#
# chkconfig: 345 90 60
# description: cachlogd is the mnogosearch cache mode daemon that accepts \
#              connections from the indexer and orders data into raw files \
#              for subsequent processing by the splitter. 
# processname: cachlogd
# pidfile: /var/run/cachelogd.pid

# Source function library.
. /etc/init.d/functions

RETVAL=0

# See how we were called.
  
prog="cachelogd"

start() {
	echo -n $"Starting $prog: "
	cachelogd &
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/cachelogd
	return $RETVAL
}

stop() {
	echo -n $"Stopping $prog: "
	killproc cachelogd
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/cachelogd
	return $RETVAL
}	

rhstatus() {
	status cachelogd
}	

restart() {
  	stop
	start
}	

case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  restart)
  	restart
	;;
  status)
  	rhstatus
	;;
  *)
	echo $"Usage: $0 {start|stop|status|restart}"
	exit 1
esac

exit $?
