[yocto] [meta-cgl][PATCH 05/10] cluster-glue: provide tmpfiles configuration

Dmitry Eremin-Solenikov dmitry_eremin at mentor.com
Fri May 8 13:13:25 PDT 2015


provide systemd-tmpfiles configuration for distributions using systemd.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin at mentor.com>
---
 .../recipes-cgl/cluster-glue/cluster-glue/tmpfiles            |  7 +++++++
 .../recipes-cgl/cluster-glue/cluster-glue_1.0.5.bb            | 11 ++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 meta-cgl-common/recipes-cgl/cluster-glue/cluster-glue/tmpfiles

diff --git a/meta-cgl-common/recipes-cgl/cluster-glue/cluster-glue/tmpfiles b/meta-cgl-common/recipes-cgl/cluster-glue/cluster-glue/tmpfiles
new file mode 100644
index 0000000..252e13f
--- /dev/null
+++ b/meta-cgl-common/recipes-cgl/cluster-glue/cluster-glue/tmpfiles
@@ -0,0 +1,7 @@
+d /var/lib/heartbeat 0755 root root -
+d /var/lib/heartbeat/pengine 0750 hacluster haclient -
+d /var/lib/heartbeat/cores 0755 hacluster haclient -
+d /var/lib/heartbeat/cores/hacluster 0700 hacluster haclient -
+d /var/lib/heartbeat/cores/root 0700 root root -
+d /var/lib/heartbeat/cores/nobody 0700 nobody nogroup -
+
diff --git a/meta-cgl-common/recipes-cgl/cluster-glue/cluster-glue_1.0.5.bb b/meta-cgl-common/recipes-cgl/cluster-glue/cluster-glue_1.0.5.bb
index adf3b48..f1b4a78 100644
--- a/meta-cgl-common/recipes-cgl/cluster-glue/cluster-glue_1.0.5.bb
+++ b/meta-cgl-common/recipes-cgl/cluster-glue/cluster-glue_1.0.5.bb
@@ -13,6 +13,7 @@ SRC_URI = " \
     file://glue-remove-getpid-check.patch \
     file://fix-const-cast.patch \
     file://volatiles \
+    file://tmpfiles \
 	"
 SRC_URI_append_libc-uclibc = " file://kill-stack-protector.patch"
 SRC_URI[md5sum] = "d2b6f798e58ef2497526e404b8ad640a"
@@ -39,10 +40,18 @@ do_configure_prepend() {
 do_install_append() {
 	install -d ${D}${sysconfdir}/default/volatiles
 	install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/04_cluster-glue
+	install -d ${D}${sysconfdir}/tmpfiles.d
+	install -m 0644 ${WORKDIR}/tmpfiles ${D}${sysconfdir}/tmpfiles.d/${PN}.conf
 }
 
 pkg_postinst_${PN} () {
-	/etc/init.d/populate-volatile.sh update
+	if [ -z "$D" ]; then
+		if type systemd-tmpfiles >/dev/null; then
+			systemd-tmpfiles --create
+		elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
+			${sysconfdir}/init.d/populate-volatile.sh update
+		fi
+	fi
 }
 
 PACKAGES += "\
-- 
2.1.4




More information about the yocto mailing list