]> git.pld-linux.org Git - packages/acpid.git/blob - acpid.init
- typo
[packages/acpid.git] / acpid.init
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 # Initial values (just in case):
15 LAPTOP_MODULES=""
16 VARIOUS_MODULES=""
17 ASUS_LAPTOP=""
18 TOSHIBA_LAPTOP=""
19
20 # Configuration file.
21 . /etc/sysconfig/acpid
22
23 RETVAL=0
24 # See how we were called.
25 case "$1" in
26   start)
27         # Start daemons.
28         if [ ! -f /var/lock/subsys/acpid ]; then
29                 if [ ! -d /proc/acpi/button ]; then
30                         _modprobe ospm_button
31                         _modprobe button
32                 fi
33                 if [ "$(kernelverser)" -lt "002006" ] && is_yes "$MODPROBE_OSPM_SYSTEM"; then
34                         _modprobe single ospm_system
35                 fi
36                 # Load additional modules:
37                 if [ -n "$LAPTOP_MODULES" ]; then
38                         for i in $LAPTOP_MODULES; do
39                                 _modprobe single $i
40                         done
41                 fi
42                 if [ -n "$VARIOUS_MODULES" ]; then
43                         for i in $VARIOUS_MODULES; do
44                                 _modprobe single $i
45                         done
46                 fi
47                 # Determine if it's ASUS or TOSHIBA laptop
48                 if is_yes "$ASUS_LAPTOP"; then
49                         _modprobe asus_acpi
50                 elif is_yes "$TOSHIBA_LAPTOP"; then
51                         _modprobe toshiba_acpi
52                 elif is_yes "$IBM_LAPTOP"; then
53                         _modprobe ibm_acpi
54                 fi
55                 # starting:
56                 msg_starting acpid $PROGRAM_ARGS
57                 daemon acpid
58                 RETVAL=$?
59                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/acpid
60         else
61                 msg_already_running acpid
62         fi
63         ;;
64   stop)
65         # Stop daemons.
66         if [ -f /var/lock/subsys/acpid ]; then
67                 msg_stopping acpid
68                 killproc acpid
69                 rm -f /var/lock/subsys/acpid >/dev/null 2>&1
70         else
71                 msg_not_running acpid
72         fi
73         ;;
74   reload|force-reload)
75         if [ -f /var/lock/subsys/acpid ]; then
76                 msg_reloading acpid
77                 killproc acpid -HUP
78                 RETVAL=$?
79         else
80                 msg_not_running acpid >&2
81                 exit 7
82         fi
83         ;;
84   restart)
85         $0 stop
86         $0 start
87         exit $?
88         ;;
89   status)
90         status acpid
91         exit $?
92         ;;
93   *)
94         msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
95         exit 3
96 esac
97
98 exit $RETVAL
This page took 0.151476 seconds and 3 git commands to generate.