#!/bin/sh
# Startup script for lkst disk logging daemon
#
# chkconfig: - 70 30
# description: Run the disk logging daemon for Linux Kernel State Tracer
# processname: lkstlogd
# pidfile: /var/run/lkstlogd.pid

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

[ -x /usr/sbin/lkstlogd ] || exit 0
[ -x /usr/sbin/lkst ] || exit 0

prog=lkstlogd

start() {
    echo -n $"Starting $prog: "
    if /usr/sbin/lkst all &>/dev/null ;then
        daemon /usr/sbin/lkstlogd -a
    else
	echo -n "LKST is not active... "
        echo_failure
    fi
    echo
}

stop() {
    echo -n $"Stopping $prog: "
    killproc lkstlogd -TERM
    echo 
}

pause() {
    echo -n $"Pause/Resume lkstlogd: "
    killproc lkstlogd -USR1
    echo
}

case "$1" in
	start)
	    start
	    ;;
	
	stop)
	    stop
	    ;;
	
	status)
	    status lkstlogd
	    ;;

	resume)
            pause
	    ;;

	pause)
	    pause
	    ;;
	    
	restart)
	    stop
	    start
	    ;;
	
	*)
	    echo $"Usage: $0 {start|stop|restart|status|pause|resume}"
	    exit 1

esac

exit 0
