]> git.pld-linux.org Git - packages/acpid.git/blob - acpid.init
- killed my previous bogus "fixes"
[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                 RETVAL=$?
52         else
53                 msg_not_running acpid
54                 exit 1
55         fi
56         ;;
57   restart)
58         $0 stop
59         $0 start
60         ;;
61   status)
62         status acpid
63         ;;
64   *)
65         msg_usage "$0 {start|stop|restart|reload|status}"
66         exit 1
67 esac
68
69 exit $RETVAL
This page took 0.079365 seconds and 4 git commands to generate.