]> git.pld-linux.org Git - packages/acpid.git/blob - acpid.init
- Run modprobe ospm_system on startup
[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 [ ! -f /proc/acpi/event ]; then
25                         _modprobe single ospm_button
26                 fi
27                 if is_yes "$MODPROBE_OSPM_SYSTEM"; then
28                         _modprobe single ospm_system
29                 fi
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
46         fi
47         ;;
48   reload|force-reload)
49         if [ -f /var/lock/subsys/acpid ]; then
50                 msg_reloading acpid
51                 killproc acpid -HUP
52                 RETVAL=$?
53         else
54                 msg_not_running acpid >&2
55                 exit 7
56         fi
57         ;;
58   restart)
59         $0 stop
60         $0 start
61         exit =$?
62         ;;
63   status)
64         status acpid
65         exit =$?
66         ;;
67   *)
68         msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
69         exit 3
70 esac
71
72 exit $RETVAL
This page took 0.069526 seconds and 4 git commands to generate.