]> git.pld-linux.org Git - packages/acpid.git/blame - acpid.init
- rel 2
[packages/acpid.git] / acpid.init
CommitLineData
94f6e9a1
PG
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
d8325167
PG
14# Initial values (just in case):
15LAPTOP_MODULES=""
16VARIOUS_MODULES=""
17ASUS_LAPTOP=""
18TOSHIBA_LAPTOP=""
19
94f6e9a1
PG
20# Configuration file.
21. /etc/sysconfig/acpid
22
37b4ae3e
ER
23# Start daemons.
24start() {
c0743e1f 25 if [ ! -f /var/lock/subsys/acpid ]; then
6fcf695c 26 if [ ! -d /proc/acpi/button ]; then
95c09b5b
ER
27 modprobe -s ospm_button
28 modprobe -s button
9f8958e5 29 fi
4cfcd4bc 30 if [ "$(kernelverser)" -lt "002006" ] && is_yes "$MODPROBE_OSPM_SYSTEM"; then
95c09b5b 31 modprobe -s ospm_system
f315a54f 32 fi
d8325167 33 # Load additional modules:
a4b7b25d 34 if [ -n "$LAPTOP_MODULES" ]; then
782b6c6f 35 for i in $LAPTOP_MODULES; do
95c09b5b 36 modprobe -s $i
d8325167 37 done
a3be5270
PG
38 fi
39 if [ -n "$VARIOUS_MODULES" ]; then
782b6c6f 40 for i in $VARIOUS_MODULES; do
95c09b5b 41 modprobe -s $i
d8325167
PG
42 done
43 fi
44 # Determine if it's ASUS or TOSHIBA laptop
45 if is_yes "$ASUS_LAPTOP"; then
95c09b5b 46 modprobe -s asus_acpi
d8325167 47 elif is_yes "$TOSHIBA_LAPTOP"; then
95c09b5b 48 modprobe -s toshiba_acpi
461c3aff 49 elif is_yes "$IBM_LAPTOP"; then
95c09b5b 50 modprobe -s ibm_acpi
d8325167 51 fi
299a6963
PG
52 # starting:
53 msg_starting acpid $PROGRAM_ARGS
c0743e1f 54 daemon acpid
55 RETVAL=$?
56 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/acpid
57 else
58 msg_already_running acpid
59 fi
37b4ae3e
ER
60}
61
62# Stop daemons.
63stop() {
c0743e1f 64 if [ -f /var/lock/subsys/acpid ]; then
65 msg_stopping acpid
66 killproc acpid
67 rm -f /var/lock/subsys/acpid >/dev/null 2>&1
68 else
69 msg_not_running acpid
c0743e1f 70 fi
37b4ae3e
ER
71}
72
73RETVAL=0
74# See how we were called.
75case "$1" in
76 start)
77 start
78 ;;
79 stop)
80 stop
81 ;;
82 restart)
83 stop
84 start
c0743e1f 85 ;;
1b772a07 86 reload|force-reload)
c0743e1f 87 if [ -f /var/lock/subsys/acpid ]; then
88 msg_reloading acpid
c0743e1f 89 killproc acpid -HUP
90 RETVAL=$?
c0743e1f 91 else
11de6553 92 msg_not_running acpid
1b772a07 93 exit 7
c0743e1f 94 fi
95 ;;
c0743e1f 96 status)
97 status acpid
98 ;;
99 *)
1b772a07 100 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
101 exit 3
94f6e9a1 102esac
c0743e1f 103
104exit $RETVAL
This page took 0.078118 seconds and 4 git commands to generate.