]> git.pld-linux.org Git - packages/acpid.git/blob - acpid.init
- new ones
[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 test -x /usr/sbin/acpid || echo "You need to check package!!"; exit 0
18
19 RETVAL=0
20
21 # See how we were called.
22 case "$1" in
23         start)
24         # Start daemons.
25                 if [ ! -f /var/lock/subsys/acpid ]; then
26                     msg_starting acpid $PROGRAM_ARGS
27                     daemon acpid
28                     RETVAL=$?
29                     [ $RETVAL -eq 0 ] && touch /var/lock/subsys/acpid
30                 else
31                         msg_already_running acpid
32                 fi
33                 ;;
34         stop)
35                 # Stop daemons.
36                 if [ -f /var/lock/subsys/acpid ]; then
37                         msg_stopping acpid
38                         killproc acpid
39                         rm -f /var/lock/subsys/acpid >/dev/null 2>&1
40                 else
41                         msg_not_running acpid
42                         exit 1
43                 fi
44                 ;;
45         reload)
46                 trap "" SIGHUP
47                 killall -HUP acpid
48                 ;;
49         restart)
50                 $0 stop
51                 $0 start
52                 ;;
53         status)
54                 status acpid
55                 ;;
56         *)
57                 msg_Usage "$0 {start|stop|restart|reload|status}"
58                 exit 1
59 esac
This page took 0.0877 seconds and 4 git commands to generate.