Blob Blame Raw
#!/bin/sh
#
# prelude lml	The prelude log analyzer    
#
# chkconfig: - 80 10
# description: The prelude log analyzer
#              when using postgresql : - 87 13
#                         mysql      : - 80 10


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

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

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

prog=prelude-lml
progpath=/usr/bin/$prog
pidfile=/var/run/${prog}.pid

[ -x $progpath ]        || exit 0
[ -d /etc/$prog ]       || exit 0

RETVAL=0

start() {
	# Start daemon.
	echo -n "Starting $prog: "
        daemon $NICELEVEL $progpath -d -P $pidfile 
	RETVAL=$?
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
        echo
	return $RETVAL	
}

stop() {
        # Stop daemons
        echo -n "Shutting down $prog: "
        killproc $prog
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog $pidfile
	return $RETVAL
}

restart() {
	stop
	start
}

case "$1" in
    start)
	start
	;;
    stop)
	stop
	;;
    restart|reload)
	stop
	start
	;;
    status)
	status $prog 
	RETVAL=$?
	;;
    *)
	echo "Usage: $0 {start|stop|restart|reload|status}"
	exit 1
esac

exit $RETVAL