#!/bin/sh
#
# lvcool	This shell script takes care of starting and stopping lvcool
#
# chkconfig:	2345 40 60
# description:	Little utility will cool your processor
# processname:	lvcool
#
# pidfile:	/var/run/lvcool.pid

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

RETVAL=0
# See how we were called.
case "$1" in
  start)
	# Start daemons.
	if [ ! -f /var/lock/subsys/lvcool ]; then
		msg_starting lvcool
		daemon lvcool -y
		RETVAL=$?
		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/lvcool
	else
		msg_already_running lvcool
	fi
	;;
  stop)
	# Stop daemons.
	if [ -f /var/lock/subsys/lvcool ]; then
		msg_stopping lvcool
		killproc lvcool
		rm -f /var/lock/subsys/lvcool >/dev/null 2>&1
	else
		msg_not_running lvcool
	fi
	;;
  restart|force-reload)
	$0 stop
	$0 start
	exit $?
	;;
  status)
	status lvcool
	exit $?
	;;
  *)
	msg_usage "$0 {start|stop|restart|force-reload|status}"
	exit 3
esac

exit $RETVAL
