Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/bash## /etc/rc.d/init.d/acpid## Starts the acpi daemon## chkconfig: 345 26 74# description: Listen and dispatch ACPI events from the kernel# processname: acpid### BEGIN INIT INFO# Provides: acpid# Required-Start: $syslog $local_fs# Required-Stop: $syslog $local_fs# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: start and stop acpid# Description: Listen and dispatch ACPI events from the kernel### END INIT INFO# Source function library.. /etc/rc.d/init.d/functionsRETVAL=0## See how we were called.#check() {# Check that we're a privileged user[ `id -u` = 0 ] || exit 4# Check if acpid is executabletest -x /usr/sbin/acpid || exit 5}start() {check# Check for kernel support[ -f /proc/acpi/event ] || exit 1# Check if it is already runningif [ ! -f /var/lock/subsys/acpid ]; thenecho -n $"Starting acpi daemon: "daemon /usr/sbin/acpidRETVAL=$?[ $RETVAL -eq 0 ] && touch /var/lock/subsys/acpidechofireturn $RETVAL}stop() {checkecho -n $"Stopping acpi daemon: "killproc /usr/sbin/acpidRETVAL=$?[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/acpidechoreturn $RETVAL}restart() {stopstart}reload() {checktrap "" SIGHUPaction $"Reloading acpi daemon:" killall -HUP acpidRETVAL=$?return $RETVAL}case "$1" instart)start;;stop)stop;;reload)reload;;force-reload)echo "$0: Unimplemented feature."RETVAL=3;;restart)restart;;condrestart)if [ -f /var/lock/subsys/acpid ]; thenrestartfi;;status)status acpidRETVAL=$?;;*)echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"RETVAL=2esacexit $RETVAL