diff options
author | Robert Schwebel <r.schwebel@pengutronix.de> | 2009-05-08 14:10:51 +0000 |
---|---|---|
committer | Robert Schwebel <r.schwebel@pengutronix.de> | 2009-05-08 14:10:51 +0000 |
commit | 8dfa7cbcafc56254f735503d080349e4731fe8d8 (patch) | |
tree | 0cf3f5cf0b6a41cebcf4c4d82d76e00e7d3116a1 /generic | |
parent | a72f8ab8599906c9f203a5a1000aabaab819bc57 (diff) | |
download | ptxdist-8dfa7cbcafc56254f735503d080349e4731fe8d8.tar.gz ptxdist-8dfa7cbcafc56254f735503d080349e4731fe8d8.tar.xz |
* acpid: add start-stop script
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@10407 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'generic')
-rw-r--r-- | generic/etc/init.d/acpid | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/generic/etc/init.d/acpid b/generic/etc/init.d/acpid index 4c81c5aaa..81e97631b 100644 --- a/generic/etc/init.d/acpid +++ b/generic/etc/init.d/acpid @@ -1,4 +1,41 @@ #!/bin/sh -exit +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 |