]> code.ossystems Code Review - openembedded-core.git/commitdiff
Revert "sysstat: use service file from source codes"
authorRoss Burton <ross.burton@intel.com>
Fri, 12 Jul 2019 12:49:25 +0000 (13:49 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 15 Jul 2019 08:26:46 +0000 (09:26 +0100)
This doesn't actually work as the unit file is only installed if cron support is
enabled.

This reverts commit 721f09d4897425c7131470bd756eee1b90937feb.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-extended/sysstat/sysstat.inc
meta/recipes-extended/sysstat/sysstat/sysstat.service [new file with mode: 0644]

index 9085fcfe744390ed7fbe0f513d8a69c0cde6d6ba..4e29721666031be7a1c99569b819d980544abfcd 100644 (file)
@@ -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} () {
diff --git a/meta/recipes-extended/sysstat/sysstat/sysstat.service b/meta/recipes-extended/sysstat/sysstat/sysstat.service
new file mode 100644 (file)
index 0000000..aff0710
--- /dev/null
@@ -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
+