]> git.pld-linux.org Git - packages/acpid.git/blob - acpid.init
- LSB conformance
[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                 msg_starting acpid $PROGRAM_ARGS
28                 daemon acpid
29                 RETVAL=$?
30                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/acpid
31         else
32                 msg_already_running acpid
33         fi
34         ;;
35   stop)
36         # Stop daemons.
37         if [ -f /var/lock/subsys/acpid ]; then
38                 msg_stopping acpid
39                 killproc acpid
40                 rm -f /var/lock/subsys/acpid >/dev/null 2>&1
41         else
42                 msg_not_running acpid
43         fi
44         ;;
45   reload|force-reload)
46         if [ -f /var/lock/subsys/acpid ]; then
47                 msg_reloading acpid
48                 killproc acpid -HUP
49                 RETVAL=$?
50         else
51                 msg_not_running acpid >&2
52                 exit 7
53         fi
54         ;;
55   restart)
56         $0 stop
57         $0 start
58         exit =$?
59         ;;
60   status)
61         status acpid
62         exit =$?
63         ;;
64   *)
65         msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
66         exit 3
67 esac
68
69 exit $RETVAL
This page took 0.179182 seconds and 3 git commands to generate.