diff --git a/acpid.init b/acpid.init index e647763..32b106f 100755 --- a/acpid.init +++ b/acpid.init @@ -8,12 +8,19 @@ # description: Listen and dispatch ACPI events from the kernel # processname: acpid +### BEGIN INIT INFO +# Provides: acpid +# Required-Start: $syslog +# Required-Stop: $syslog +# Default-Start: 3 4 5 +# Default-Stop: 0 1 2 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/functions -[ -x /usr/sbin/acpid ] || exit 0 -[ -f /proc/acpi/event ] || exit 0 - RETVAL=0 # @@ -21,6 +28,16 @@ RETVAL=0 # start() { + # Check if acpid is executable + if [ ! -x /usr/sbin/acpid ]; then + echo "$0: acpid is not executable." + exit 1 + fi + # Check for kernel support + if [ ! -f /proc/acpi/event ]; then + echo "$0: need ACPI support in kernel." + exit 1 + fi # Check if it is already running if [ ! -f /var/lock/subsys/acpid ]; then echo -n $"Starting acpi daemon: " @@ -38,7 +55,7 @@ stop() { RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/acpid echo - return $RETVAL + return $RETVAL } @@ -49,7 +66,9 @@ restart() { reload() { trap "" SIGHUP - killall -HUP acpid + action $"Reloading acpi daemon:" killall -HUP acpid + RETVAL=$? + return $RETVAL } case "$1" in @@ -62,6 +81,10 @@ stop) reload) reload ;; +force-reload) + echo "$0: Unimplemented feature." + RETVAL=3 + ;; restart) restart ;; @@ -72,10 +95,11 @@ condrestart) ;; status) status acpid + RETVAL=$? ;; *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" - exit 1 + echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}" + RETVAL=2 esac exit $RETVAL diff --git a/acpid.spec b/acpid.spec index b67b09e..733ab4d 100644 --- a/acpid.spec +++ b/acpid.spec @@ -1,7 +1,7 @@ Summary: ACPI Event Daemon Name: acpid Version: 1.0.4 -Release: 7%{?dist} +Release: 8%{?dist} License: GPL Group: System Environment/Daemons Source: http://prdownloads.sourceforge.net/acpid/acpid-%{version}.tar.gz @@ -87,6 +87,10 @@ if [ "$1" -ge "1" ]; then fi %changelog +* Wed Jul 25 2007 Zdenek Prikryl - 1.0.4-8.fc8 +- Fixed init script to comply with LSB standard +- Resolves: #237754 + * Wed Feb 14 2007 Phil Knirsch - 1.0.4-7.fc7 - Dropped /var/log/acpid ownership as per review (225237)