]> git.pld-linux.org Git - packages/acpid.git/blame - acpid.init
- new options for additional modules loaded with acpi support
[packages/acpid.git] / acpid.init
CommitLineData
94f6e9a1
PG
1#!/bin/sh
2#
3# acpid Starts the acpi daemon
4#
5# chkconfig: 345 44 56
6# description: Listen and dispatch ACPI events from the kernel
7# processname: acpid
8#
9# pidfile: /var/run/acpid.pid
10
11# Source function library.
12. /etc/rc.d/init.d/functions
13
14# Configuration file.
15. /etc/sysconfig/acpid
16
94f6e9a1
PG
17
18RETVAL=0
94f6e9a1
PG
19# See how we were called.
20case "$1" in
c0743e1f 21 start)
94f6e9a1 22 # Start daemons.
c0743e1f 23 if [ ! -f /var/lock/subsys/acpid ]; then
6fcf695c
PG
24 if [ ! -d /proc/acpi/button ]; then
25 _modprobe ospm_button
26 _modprobe button
9f8958e5 27 fi
f315a54f
JK
28 if is_yes "$MODPROBE_OSPM_SYSTEM"; then
29 _modprobe single ospm_system
30 fi
c0743e1f 31 msg_starting acpid $PROGRAM_ARGS
32 daemon acpid
33 RETVAL=$?
34 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/acpid
35 else
36 msg_already_running acpid
37 fi
38 ;;
39 stop)
40 # Stop daemons.
41 if [ -f /var/lock/subsys/acpid ]; then
42 msg_stopping acpid
43 killproc acpid
44 rm -f /var/lock/subsys/acpid >/dev/null 2>&1
45 else
46 msg_not_running acpid
c0743e1f 47 fi
48 ;;
1b772a07 49 reload|force-reload)
c0743e1f 50 if [ -f /var/lock/subsys/acpid ]; then
51 msg_reloading acpid
c0743e1f 52 killproc acpid -HUP
53 RETVAL=$?
c0743e1f 54 else
c0db550f 55 msg_not_running acpid >&2
1b772a07 56 exit 7
c0743e1f 57 fi
58 ;;
59 restart)
60 $0 stop
61 $0 start
97f1f784 62 exit $?
c0743e1f 63 ;;
64 status)
65 status acpid
97f1f784 66 exit $?
c0743e1f 67 ;;
68 *)
1b772a07 69 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
70 exit 3
94f6e9a1 71esac
c0743e1f 72
73exit $RETVAL
This page took 0.108145 seconds and 4 git commands to generate.