]> git.pld-linux.org Git - packages/acpid.git/blob - acpid.init
- cleaning
[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
20 # See how we were called.
21 case "$1" in
22   start)
23         # Start daemons.
24         if [ ! -f /var/lock/subsys/acpid ]; then
25                 if [ ! -f /proc/acpi/event ]; then
26                         modprobe ospm_button
27                 fi
28                 msg_starting acpid $PROGRAM_ARGS
29                 daemon acpid
30                 RETVAL=$?
31                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/acpid
32         else
33                 msg_already_running acpid
34         fi
35         ;;
36   stop)
37         # Stop daemons.
38         if [ -f /var/lock/subsys/acpid ]; then
39                 msg_stopping acpid
40                 killproc acpid
41                 rm -f /var/lock/subsys/acpid >/dev/null 2>&1
42         else
43                 msg_not_running acpid
44                 exit 1
45         fi
46         ;;
47   reload)
48         if [ -f /var/lock/subsys/acpid ]; then
49                 msg_reloading acpid
50                 busy
51                 killproc acpid -HUP
52                 RETVAL=$?
53                 [ $RETVAL -eq 0 ] && ok || died
54         else
55                 msg_not_running acpid
56                 exit 1
57         fi
58         ;;
59   restart)
60         $0 stop
61         $0 start
62         ;;
63   status)
64         status acpid
65         ;;
66   *)
67         msg_usage "$0 {start|stop|restart|reload|status}"
68         exit 1
69 esac
70
71 exit $RETVAL
This page took 0.090455 seconds and 4 git commands to generate.