aboutsummaryrefslogtreecommitdiff
path: root/etc/rc.d/init.d/acpid
blob: 0531670d3628c89b317be535fbc0ac8e413198a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
########################################################################
# Begin acpid
#
# Description : ACPI event daemon boot script
#
# Author      : Igor Živković <[email protected]>
#
# Version     : BLFS 8.0
#
########################################################################

### BEGIN INIT INFO
# Provides:            acpid
# Required-Start:
# Should-Start:        $syslog
# Required-Stop:
# Should-Stop:         $syslog
# Default-Start:       2 3 4 5
# Default-Stop:        0 1 6
# Short-Description:   Starts Advanced Configuration and Power Interface event daemon
# X-LFS-Provided-By:   BLFS
### END INIT INFO

. /lib/lsb/init-functions

case "$1" in
   start)
      log_info_msg "Starting ACPI event daemon..."
      start_daemon /usr/sbin/acpid
      sleep 1
      pidofproc -p "/run/acpid.pid" > /dev/null
      evaluate_retval
      ;;

   stop)
      log_info_msg "Stopping ACPI event daemon..."
      killproc -p "/run/acpid.pid" /usr/sbin/acpid
      evaluate_retval
      ;;

   restart)
      $0 stop
      sleep 1
      $0 start
      ;;

   status)
      statusproc /usr/sbin/acpid
      ;;

   *)
      echo "Usage: $0 {start|stop|restart|status}"
      exit 1
      ;;
esac

# End acpid