[PATCH 0/2]acpid: make the initscript friendly to user

STALE4783d

3 messages, 1 author, 2013-09-03 · open the first message on its own page

[PATCH 0/2]acpid: make the initscript friendly to user

From: Bian Naimeng <hidden>
Date: 2013-09-03 08:30:54

At default, the ${sysconfdir}/acpi/events will be not installed,
but initscript depends on it while starting acpid daemon.

If rule directory "${sysconfdir}/acpi/events" 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.

The following patchs try to make the initscript friendly to user.

Bian Naimeng (2):
 acpid: install events directory at default.
 acpid: print message if rule directory is inexist.

[PATCH 1/2]acpid: install events directory at default.

From: Bian Naimeng <hidden>
Date: 2013-09-03 08:32:50

acpid: install events directory at default.

If rule directory "${sysconfdir}/acpi/events" is inexist, 
the acpid initscript will exit with success, but the daemon will be not running.

Signed-off-by: Bian Naimeng <redacted>

---
 meta/recipes-bsp/acpid/acpid.inc |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/meta/recipes-bsp/acpid/acpid.inc b/meta/recipes-bsp/acpid/acpid.inc
index 1ffe6ff..40293c5 100644
--- a/meta/recipes-bsp/acpid/acpid.inc
+++ b/meta/recipes-bsp/acpid/acpid.inc
@@ -27,4 +27,7 @@ do_install () {
 	install -d ${D}${sysconfdir}/init.d
 	cat ${WORKDIR}/init | sed -e's,/usr/sbin,${sbindir},g' > ${D}${sysconfdir}/init.d/acpid
 	chmod 755 ${D}${sysconfdir}/init.d/acpid
+
+	install -d ${D}${sysconfdir}/acpi
+	install -d ${D}${sysconfdir}/acpi/events
 }
-- 
1.7.7



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

From: Bian Naimeng <hidden>
Date: 2013-09-03 08:33:54

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 <redacted>

---
 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



Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help