]> git.pld-linux.org Git - packages/acpid.git/blob - acpid.init
- load button module (in 2.6 kernels), proper detection if module should be
[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 # Configuration file.
15 . /etc/sysconfig/acpid
16
17
18 RETVAL=0
19 # See how we were called.
20 case "$1" in
21   start)
22         # Start daemons.
23         if [ ! -f /var/lock/subsys/acpid ]; then
24                 if [ ! -d /proc/acpi/button ]; then
25                         _modprobe ospm_button
26                         _modprobe button
27                 fi
28                 if is_yes "$MODPROBE_OSPM_SYSTEM"; then
29                         _modprobe single ospm_system
30                 fi
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
47         fi
48         ;;
49   reload|force-reload)
50         if [ -f /var/lock/subsys/acpid ]; then
51                 msg_reloading acpid
52                 killproc acpid -HUP
53                 RETVAL=$?
54         else
55                 msg_not_running acpid >&2
56                 exit 7
57         fi
58         ;;
59   restart)
60         $0 stop
61         $0 start
62         exit $?
63         ;;
64   status)
65         status acpid
66         exit $?
67         ;;
68   *)
69         msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
70         exit 3
71 esac
72
73 exit $RETVAL
This page took 0.169467 seconds and 3 git commands to generate.