]> git.pld-linux.org Git - packages/acpid.git/blob - acpid.init
- removed from doc what is in sbin (I've started too fast using it :))
[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                         killproc acpid -HUP
51                 else
52                         msg_not_running acpid
53                         exit 1
54                 fi
55                 ;;
56         restart)
57                 $0 stop
58                 $0 start
59                 ;;
60         status)
61                 status acpid
62                 ;;
63         *)
64                 msg_Usage "$0 {start|stop|restart|reload|status}"
65                 exit 1
66 esac
This page took 0.03326 seconds and 3 git commands to generate.