]> code.ossystems Code Review - openembedded-core.git/commitdiff
acpid: print message if rule directory is inexist
authorBian Naimeng <biannm@cn.fujitsu.com>
Tue, 3 Sep 2013 08:33:55 +0000 (16:33 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 6 Sep 2013 11:09:29 +0000 (12:09 +0100)
acpid: print message if rule directory is inexist

If rule directory is inexist, the acpid initscript will exit with success,
but the daemon will be not running.
Print message in this case to tell user that the daemon is not running.

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-bsp/acpid/acpid/init

index ef08b595965cdd0d32ebe7c4729e2954ed8507fd..9f2c0d48d071c05ddcf3005032f77aef25783390 100755 (executable)
@@ -6,8 +6,12 @@ test -d /proc/acpi || exit 0
 case "$1" in
   start)
     echo -n "Starting Advanced Configuration and Power Interface daemon: "
-    start-stop-daemon -S -x /usr/sbin/acpid -- -c /etc/acpi/events
-    echo "acpid."
+    if [ ! -d /etc/acpi/events ]; then
+        echo "There is not any rule configuration file."
+    else
+        start-stop-daemon -S -x /usr/sbin/acpid -- -c /etc/acpi/events
+        echo "acpid."
+    fi
     ;;
   stop)
     echo -n "Stopping Advanced Configuration and Power Interface daemon: "