#!/bin/sh
# $Id: template,v 1.3 2003/05/21 17:47:00 ldv Exp $
#
# atieventsd - The ATI External Events Daemon
#
# chkconfig: 2345 45 65
# description:  Listen and dispatch ACPI \
#		events from the kernel
#		
# processname: atieventsd
# pidfile: /var/run/atieventsd.pid
# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1

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

LOCKFILE=/var/lock/subsys/atieventsd
RETVAL=0
DAEMONOPTS=""

start()
{
	start_daemon --lockfile "$LOCKFILE" --expect-user root -- atieventsd $DAEMONOPTS
	RETVAL=$?
	return $RETVAL
}

stop()
{
	stop_daemon --lockfile "$LOCKFILE" --expect-user root -- atieventsd
	RETVAL=$?
	return $RETVAL
	rm -f $PIDFILE
}

restart()
{
	stop
	start
}

# See how we were called.
case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	restart|reload)
		restart
		;;
	condstop)
		if [ -e "$LOCKFILE" ]; then
			stop
		fi
		;;
	condrestart|condreload)
		if [ -e "$LOCKFILE" ]; then
			restart
		fi
		;;
	status)
		status --expect-user root -- atieventsd
		RETVAL=$?
		;;
	*)
		msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
		RETVAL=1
esac

exit $RETVAL
