#!/bin/sh
#
# acpid         This shell script takes care of starting and stopping
#               acpid (power and system management daemon).
#
# chkconfig: - 55 10
# description: acpid is the power and system management daemon.

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

[ -x /usr/sbin/acpid ] || exit 0

RETVAL=0

# See how we were called.
case "$1" in
  start)
        # Start daemons.
        echo -n "Starting acpid: "
        daemon acpid
	RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/acpid
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down acpid: "
	killproc acpid
	RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/acpid
        ;;
  status)
	status acpid
	RETVAL=$?
	;;
  restart|reload)
	$0 stop
	$0 start
	RETVAL=$?
	;;
  *)
        echo "Usage: acpid {start|stop|restart|status}"
        exit 1
esac

exit $RETVAL
