]>
Commit | Line | Data |
---|---|---|
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 | |
18 | RETVAL=0 | |
94f6e9a1 PG |
19 | # See how we were called. |
20 | case "$1" in | |
c0743e1f | 21 | start) |
94f6e9a1 | 22 | # Start daemons. |
c0743e1f | 23 | if [ ! -f /var/lock/subsys/acpid ]; then |
24 | if [ ! -f /proc/acpi/event ]; then | |
1b772a07 | 25 | _modprobe single ospm_button |
9f8958e5 | 26 | fi |
f315a54f JK |
27 | if is_yes "$MODPROBE_OSPM_SYSTEM"; then |
28 | _modprobe single ospm_system | |
29 | fi | |
c0743e1f | 30 | msg_starting acpid $PROGRAM_ARGS |
31 | daemon acpid | |
32 | RETVAL=$? | |
33 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/acpid | |
34 | else | |
35 | msg_already_running acpid | |
36 | fi | |
37 | ;; | |
38 | stop) | |
39 | # Stop daemons. | |
40 | if [ -f /var/lock/subsys/acpid ]; then | |
41 | msg_stopping acpid | |
42 | killproc acpid | |
43 | rm -f /var/lock/subsys/acpid >/dev/null 2>&1 | |
44 | else | |
45 | msg_not_running acpid | |
c0743e1f | 46 | fi |
47 | ;; | |
1b772a07 | 48 | reload|force-reload) |
c0743e1f | 49 | if [ -f /var/lock/subsys/acpid ]; then |
50 | msg_reloading acpid | |
c0743e1f | 51 | killproc acpid -HUP |
52 | RETVAL=$? | |
c0743e1f | 53 | else |
c0db550f | 54 | msg_not_running acpid >&2 |
1b772a07 | 55 | exit 7 |
c0743e1f | 56 | fi |
57 | ;; | |
58 | restart) | |
59 | $0 stop | |
60 | $0 start | |
1b772a07 | 61 | exit =$? |
c0743e1f | 62 | ;; |
63 | status) | |
64 | status acpid | |
1b772a07 | 65 | exit =$? |
c0743e1f | 66 | ;; |
67 | *) | |
1b772a07 | 68 | msg_usage "$0 {start|stop|restart|reload|force-reload|status}" |
69 | exit 3 | |
94f6e9a1 | 70 | esac |
c0743e1f | 71 | |
72 | exit $RETVAL |