Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 34ff4453f35a644ee451540f10a55be4 > files > 8

medusa-0.5.1-10mdk.ppc.rpm

#!/bin/sh
#
# medusa	This shell script takes care of starting and stopping
#               medusa daemons
#
# chkconfig: 345 99 00
# description: Medusa is software that allows you to quickly search your system for particular types of files, using an index. 
#
# Source function library.
. /etc/rc.d/init.d/functions


indexing_is_enabled=`/usr/sbin/medusa-test-indexing-status`


start() {
    if [ "$indexing_is_enabled" != "Indexing is enabled." ]
	then
	exit 1
    fi

    gprintf "Starting Medusa index daemon: "
    daemon --user root "/usr/bin/medusa-indexd &"
    echo
    gprintf "Starting Medusa search daemon: "
    daemon /usr/bin/medusa-searchd
    touch /var/lock/subsys/medusa
    echo
}

stop() {
    PID=`pidofproc medusa-indexd`
    if [ -n "$PID" ]; then
      gprintf "Shutting down Medusa index daemon: "
      killproc medusa-indexd
      echo
    fi

    gprintf "Shutting down Medusa search daemon: "
    killproc medusa-searchd
    echo
    rm -f /var/lock/subsys/medusa
    echo
}


case "$1" in
    start)
	start
	;;
 
    stop)
	stop
	;;
 
    restart | reload)
	stop
	start
	;;

    status)
        status medusa-indexd
        status medusa-searchd
        ;;

    *)
	echo "Usage: $0 {start|stop|restart|status}" >&2
	exit 1
	;;
esac