diff mbox series

[2/2] sysstat:The sysstat.service in source should be installed for cron with systemd

Message ID 20190712124926.32150-2-ross.burton@intel.com
State New
Headers show
Series [1/2] Revert "sysstat: use service file from source codes" | expand

Commit Message

Ross Burton July 12, 2019, 12:49 p.m. UTC
From: Haiqing Bai <Haiqing.Bai@windriver.com>


The sysstat.service script in source launchs sysstat-collect and sysstat-summary
services when cron is installed with systemd. At this time, the upstream
sysstat.service must be installed.

Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 meta/recipes-extended/sysstat/sysstat.inc | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

-- 
2.20.1

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/recipes-extended/sysstat/sysstat.inc b/meta/recipes-extended/sysstat/sysstat.inc
index 4e297216660..592cbf45743 100644
--- a/meta/recipes-extended/sysstat/sysstat.inc
+++ b/meta/recipes-extended/sysstat/sysstat.inc
@@ -20,6 +20,7 @@  inherit autotools-brokensep gettext systemd upstream-version-is-even
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[lm-sensors] = "--enable-sensors,--disable-sensors,lmsensors,lmsensors-libsensors"
 PACKAGECONFIG[cron] = "--enable-install-cron --enable-copy-only,--disable-install-cron --disable-copy-only"
+PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir}"
 
 EXTRA_OECONF += "--disable-stripping"
 
@@ -44,11 +45,13 @@  do_install() {
 	        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
-	sed -i -e 's#@LIBDIR@#${libdir}#g' ${D}${systemd_unitdir}/system/sysstat.service
+	        if ${@bb.utils.contains('PACKAGECONFIG', 'cron', 'false', 'true', d)}; then
+			install -d ${D}${systemd_unitdir}/system
+			install -m 0644 ${WORKDIR}/sysstat.service ${D}${systemd_unitdir}/system
+			sed -i -e 's#@LIBDIR@#${libdir}#g' ${D}${systemd_unitdir}/system/sysstat.service
+	        fi
+	fi
 }
 
 pkg_postinst_${PN} () {