#!/bin/sh
#
# searchd          Start/Stop the mnoGoSearch search daemon.
#
# chkconfig: 345 90 60
# description: cached is the mnoGoSearch search daemon that accepts \
#              connections from the indexer.
# probe: false
# processname: searchd
# pidfile: /var/lib/mnogosearch/searchd.pid
# config: /etc/mnogosearch/searchd.conf

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

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0

[ -f /etc/mnogosearch/searchd.conf ] || exit 0
[ -f /usr/sbin/searchd ] || exit 0

UDM_CONF_DIR="/etc/mnogosearch"; export UDM_CONF_DIR

# See how we were called.
case "$1" in
start)
	echo -n "Starting the mnoGoSearch search daemon: "
	searchd -v 1 & >/dev/null 2>/dev/null 
	echo_success
	echo
	touch /var/lock/subsys/searchd
	;;
stop)
	echo -n "Shutting down the mnoGoSearch search daemon: "
	killproc searchd
	echo
	rm -f /var/lock/subsys/searchd
	;;
status)
	status searchd
	;;
restart|reload)
	$0 stop
	$0 start
	;;
condrestart)
	[ -f /var/lock/subsys/searchd ] && restart
	;;
  *)
	echo "Usage: searchd {start|stop|status|restart|condrestart|reload}"
	exit 1
esac

exit 0
