[OE-core] [PATCH 2/2]acpid: print message if rule directory is inexist

Bian Naimeng biannm at cn.fujitsu.com
Tue Sep 3 08:33:55 UTC 2013


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 at cn.fujitsu.com>

---
 meta/recipes-bsp/acpid/acpid/init |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-bsp/acpid/acpid/init b/meta/recipes-bsp/acpid/acpid/init
index ef08b59..9f2c0d4 100755
--- a/meta/recipes-bsp/acpid/acpid/init
+++ b/meta/recipes-bsp/acpid/acpid/init
@@ -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: "
-- 
1.7.7






More information about the Openembedded-core mailing list