summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/sysstat
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2017-08-10 09:46:04 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-16 00:01:42 +0100
commit652e515cbdf0f6314b63ec52b9fcac42299c3d60 (patch)
tree8b0ed1493003480227bc782830bb0f68bad1fef8 /meta/recipes-extended/sysstat
parent95e1341b49f7184d280a03f64f131a4468a06867 (diff)
downloadopenembedded-core-652e515cbdf0f6314b63ec52b9fcac42299c3d60.tar.gz
sysstat: fix creating configuration file for /var/log/sa
Fix to create configuration file related to /var/log/sa for sysvinit and systemd systems respectively. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/sysstat')
-rw-r--r--meta/recipes-extended/sysstat/sysstat.inc12
1 files changed, 9 insertions, 3 deletions
diff --git a/meta/recipes-extended/sysstat/sysstat.inc b/meta/recipes-extended/sysstat/sysstat.inc
index 18b0861bf9..61da4cde0f 100644
--- a/meta/recipes-extended/sysstat/sysstat.inc
+++ b/meta/recipes-extended/sysstat/sysstat.inc
@@ -32,10 +32,16 @@ do_install() {
autotools_do_install
# don't install /var/log/sa when populating rootfs. Do it through volatile
-
rm -rf ${D}/var
- install -d ${D}/etc/default/volatiles
- install -m 0644 ${WORKDIR}/99_sysstat ${D}/etc/default/volatiles
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ install -d ${D}/etc/default/volatiles
+ install -m 0644 ${WORKDIR}/99_sysstat ${D}/etc/default/volatiles
+ fi
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d ${localstatedir}/log/sa - - - -" \
+ > ${D}${sysconfdir}/tmpfiles.d/sysstat.conf
+ fi
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/sysstat.service ${D}${systemd_unitdir}/system