#!/bin/sh # # acpid Starts the acpi daemon # # chkconfig: 345 44 56 # description: Listen and dispatch ACPI events from the kernel # processname: acpid # # pidfile: /var/run/acpid.pid # Source function library. . /etc/rc.d/init.d/functions # Initial values (just in case): LAPTOP_MODULES="" VARIOUS_MODULES="" ASUS_LAPTOP="" TOSHIBA_LAPTOP="" # Configuration file. . /etc/sysconfig/acpid # Start daemons. start() { if [ -f /var/lock/subsys/acpid ]; then msg_already_running "ACPI Event Daemon" return fi if [ ! -d /proc/acpi/button ]; then modprobe -s button fi # Load additional modules: if [ -n "$LAPTOP_MODULES" ]; then for i in $LAPTOP_MODULES; do modprobe -s $i done fi if [ -n "$VARIOUS_MODULES" ]; then for i in $VARIOUS_MODULES; do modprobe -s $i done fi # Determine if it's ASUS or TOSHIBA laptop if is_yes "$ASUS_LAPTOP"; then modprobe -s asus_acpi elif is_yes "$TOSHIBA_LAPTOP"; then modprobe -s toshiba_acpi fi # starting: msg_starting "ACPI Event Daemon" daemon /usr/sbin/acpid $PROGRAM_ARGS RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/acpid } # Stop daemons. stop() { if [ ! -f /var/lock/subsys/acpid ]; then msg_not_running "ACPI Event Daemon" return fi msg_stopping "ACPI Event Daemon" killproc acpid rm -f /var/lock/subsys/acpid >/dev/null 2>&1 } condrestart() { if [ ! -f /var/lock/subsys/acpid ]; then msg_not_running "ACPI Event Daemon" RETVAL=$1 return fi stop start } RETVAL=0 # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop start ;; try-restart) condrestart 0 ;; reload|force-reload) if [ -f /var/lock/subsys/acpid ]; then msg_reloading "ACPI Event Daemon" killproc acpid -HUP RETVAL=$? else msg_not_running "ACPI Event Daemon" exit 7 fi ;; status) status acpid ;; *) msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}" exit 3 esac exit $RETVAL