]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
sysstat: add systemd service files
authorLi xin <lixin.fnst@cn.fujitsu.com>
Fri, 12 Jun 2015 06:13:40 +0000 (14:13 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 2 Sep 2015 22:46:08 +0000 (23:46 +0100)
Add sysstat.service to support systemd systems.

Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.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 40630070d8506e684ef73a7614bd38a23354a2e6..5c761fa69324fafb5edd092dd29d6c244b2ee47c 100644 (file)
@@ -6,15 +6,20 @@ SECTION = "console/utils"
 
 SRC_URI = "http://pagesperso-orange.fr/sebastien.godard/sysstat-${PV}.tar.xz \
            file://99_sysstat \
+           file://sysstat.service \
           "
 
 DEPENDS += "base-passwd"
 
-inherit autotools-brokensep gettext
+inherit autotools-brokensep gettext systemd
 
 EXTRA_OECONF += "--disable-sensors"
 EXTRA_OEMAKE += 'LFLAGS=""'
 
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "sysstat.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
 do_configure_prepend() {
     export sa_lib_dir=${libdir}/sa
 }
@@ -27,6 +32,10 @@ do_install() {
        rm -rf ${D}/var
        install -d ${D}/etc/default/volatiles
        install -m 0644 ${WORKDIR}/99_sysstat ${D}/etc/default/volatiles
+
+       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
+