Fixed init script to comply with LSB standard
This commit is contained in:
parent
eb5f4fa82d
commit
20aacf09f1
38
acpid.init
38
acpid.init
@ -8,12 +8,19 @@
|
|||||||
# description: Listen and dispatch ACPI events from the kernel
|
# description: Listen and dispatch ACPI events from the kernel
|
||||||
# processname: acpid
|
# 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.
|
# Source function library.
|
||||||
. /etc/rc.d/init.d/functions
|
. /etc/rc.d/init.d/functions
|
||||||
|
|
||||||
[ -x /usr/sbin/acpid ] || exit 0
|
|
||||||
[ -f /proc/acpi/event ] || exit 0
|
|
||||||
|
|
||||||
RETVAL=0
|
RETVAL=0
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -21,6 +28,16 @@ RETVAL=0
|
|||||||
#
|
#
|
||||||
|
|
||||||
start() {
|
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
|
# Check if it is already running
|
||||||
if [ ! -f /var/lock/subsys/acpid ]; then
|
if [ ! -f /var/lock/subsys/acpid ]; then
|
||||||
echo -n $"Starting acpi daemon: "
|
echo -n $"Starting acpi daemon: "
|
||||||
@ -38,7 +55,7 @@ stop() {
|
|||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/acpid
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/acpid
|
||||||
echo
|
echo
|
||||||
return $RETVAL
|
return $RETVAL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -49,7 +66,9 @@ restart() {
|
|||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
trap "" SIGHUP
|
trap "" SIGHUP
|
||||||
killall -HUP acpid
|
action $"Reloading acpi daemon:" killall -HUP acpid
|
||||||
|
RETVAL=$?
|
||||||
|
return $RETVAL
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -62,6 +81,10 @@ stop)
|
|||||||
reload)
|
reload)
|
||||||
reload
|
reload
|
||||||
;;
|
;;
|
||||||
|
force-reload)
|
||||||
|
echo "$0: Unimplemented feature."
|
||||||
|
RETVAL=3
|
||||||
|
;;
|
||||||
restart)
|
restart)
|
||||||
restart
|
restart
|
||||||
;;
|
;;
|
||||||
@ -72,10 +95,11 @@ condrestart)
|
|||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
status acpid
|
status acpid
|
||||||
|
RETVAL=$?
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
|
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
|
||||||
exit 1
|
RETVAL=2
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit $RETVAL
|
exit $RETVAL
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
Summary: ACPI Event Daemon
|
Summary: ACPI Event Daemon
|
||||||
Name: acpid
|
Name: acpid
|
||||||
Version: 1.0.4
|
Version: 1.0.4
|
||||||
Release: 7%{?dist}
|
Release: 8%{?dist}
|
||||||
License: GPL
|
License: GPL
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
Source: http://prdownloads.sourceforge.net/acpid/acpid-%{version}.tar.gz
|
Source: http://prdownloads.sourceforge.net/acpid/acpid-%{version}.tar.gz
|
||||||
@ -87,6 +87,10 @@ if [ "$1" -ge "1" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jul 25 2007 Zdenek Prikryl <zprikryl@redhat.com> - 1.0.4-8.fc8
|
||||||
|
- Fixed init script to comply with LSB standard
|
||||||
|
- Resolves: #237754
|
||||||
|
|
||||||
* Wed Feb 14 2007 Phil Knirsch <pknirsch@redhat.com> - 1.0.4-7.fc7
|
* Wed Feb 14 2007 Phil Knirsch <pknirsch@redhat.com> - 1.0.4-7.fc7
|
||||||
- Dropped /var/log/acpid ownership as per review (225237)
|
- Dropped /var/log/acpid ownership as per review (225237)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user