2004-09-09 02:52:44 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# /etc/rc.d/init.d/acpid
|
|
|
|
#
|
|
|
|
# Starts the acpi daemon
|
|
|
|
#
|
|
|
|
# chkconfig: 345 44 56
|
|
|
|
# description: Listen and dispatch ACPI events from the kernel
|
|
|
|
# processname: acpid
|
|
|
|
|
|
|
|
# Source function library.
|
|
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
|
|
|
|
[ -x /usr/sbin/acpid ] || exit 0
|
|
|
|
[ -f /proc/acpi/event ] || exit 0
|
|
|
|
|
|
|
|
RETVAL=0
|
|
|
|
|
|
|
|
#
|
|
|
|
# See how we were called.
|
|
|
|
#
|
|
|
|
|
|
|
|
start() {
|
|
|
|
# Check if it is already running
|
2004-09-09 02:52:56 +00:00
|
|
|
if [ ! -f /var/lock/subsys/acpid ]; then
|
2004-09-09 02:52:44 +00:00
|
|
|
echo -n $"Starting acpi daemon: "
|
2004-09-09 02:52:56 +00:00
|
|
|
daemon /usr/sbin/acpid
|
2004-09-09 02:52:44 +00:00
|
|
|
RETVAL=$?
|
2004-09-09 02:52:56 +00:00
|
|
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/acpid
|
2004-09-09 02:52:44 +00:00
|
|
|
echo
|
|
|
|
fi
|
|
|
|
return $RETVAL
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2004-09-09 02:52:56 +00:00
|
|
|
echo -n $"Stopping acpi daemon: "
|
|
|
|
killproc /usr/sbin/acpid
|
2004-09-09 02:52:44 +00:00
|
|
|
RETVAL=$?
|
2004-09-09 02:52:56 +00:00
|
|
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/acpid
|
2004-09-09 02:52:44 +00:00
|
|
|
echo
|
|
|
|
return $RETVAL
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
restart() {
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
}
|
|
|
|
|
|
|
|
reload() {
|
|
|
|
trap "" SIGHUP
|
2004-09-09 02:52:56 +00:00
|
|
|
killall -HUP acpid
|
2004-09-09 02:52:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
;;
|
|
|
|
reload)
|
|
|
|
reload
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
restart
|
|
|
|
;;
|
|
|
|
condrestart)
|
2004-09-09 02:52:56 +00:00
|
|
|
if [ -f /var/lock/subsys/acpid ]; then
|
2004-09-09 02:52:44 +00:00
|
|
|
restart
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
status)
|
2004-09-09 02:52:56 +00:00
|
|
|
status acpid
|
2004-09-09 02:52:44 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit $RETVAL
|