Skip to contentSkip to conversation

Revert "sysstat: use service file from source codes"

PATCH New Ross Burton 1 participant 2 messages Jul 12, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Revert "sysstat: use service file from source codes"

This doesn't actually work as the unit file is only installed if cron support is enabled.

This reverts commit 721f09d4897425c7131470bd756eee1b90937feb.

---
 meta/recipes-extended/sysstat/sysstat.inc            |  8 ++++++--
 .../recipes-extended/sysstat/sysstat/sysstat.service | 12 ++++++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-extended/sysstat/sysstat/sysstat.service
meta/recipes-extended/sysstat/sysstat.inc +6 -2
index 9085fcfe744..4e297216660 100644
@@ -6,6 +6,7 @@ SECTION = "console/utils"
 
 SRC_URI = "http://pagesperso-orange.fr/sebastien.godard/sysstat-${PV}.tar.xz \
            file://99_sysstat \
+           file://sysstat.service \
           "
 
 UPSTREAM_CHECK_URI = "http://sebastien.godard.pagesperso-orange.fr/download.html"
@@ -16,10 +17,9 @@ DEPENDS += "base-passwd"
 # autotools-brokensep as this package doesn't use automake
 inherit autotools-brokensep gettext systemd upstream-version-is-even
 
-PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+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"
 
@@ -45,6 +45,10 @@ do_install() {
 	        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
 }
 
 pkg_postinst_${PN} () {
meta/recipes-extended/sysstat/sysstat/sysstat.service new file +12 -0
new file mode 100644
index 00000000000..aff07109f54
@@ -0,0 +1,12 @@
+[Unit]
+Description=Resets System Activity Logs
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+User=root
+ExecStart=@LIBDIR@/sa/sa1 --boot
+
+[Install]
+WantedBy=multi-user.target
+
Signature · 1 line
2.20.1
#1 lore raw

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

From: Haiqing Bai <[email protected]>

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.

---
 meta/recipes-extended/sysstat/sysstat.inc | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
meta/recipes-extended/sysstat/sysstat.inc +7 -4
index 4e297216660..592cbf45743 100644
@@ -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} () {
Signature · 1 line
2.20.1