summaryrefslogtreecommitdiffstats
path: root/generic/etc/init.d/acpid
blob: 81e97631b5bb22a994e2d51fe34cc3548893b543 (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
#!/bin/sh

DAEMON=/usr/sbin/acpid
PIDFILE=/var/run/acpid.pid

case $1 in
start)
	echo "starting acpid"

	# don't use acpid if proc/acpi is not there.
	if [ ! -e /proc/acpi/event ]; then
		echo "failed"
		echo "error: proc/acpi/event not here"
		exit 1
	fi

	# Start the acpid daemon to continually
	# watch for, and act on, acpievents
	echo -n "Starting acpid..."
	start-stop-daemon --start --oknodo \
		--pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS

	if [ "$?" = "0" ]; then
		echo "done"
		exit 0
	else
		echo "failed"
		exit 1
	fi

	;;
stop)
	echo "Stopping acpid"
	start-stop-daemon --stop --oknodo --quiet \
		--pidfile $PIDFILE --exec $DAEMON
	;;
*)
	echo "usage: $0 [start|stop]"
	;;
esac