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