aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2020-04-14 18:29:01 +0800
committerArmin Kuster <akuster808@gmail.com>2020-05-15 05:28:21 -0700
commit9168152b1eae7af3ccdc550eac56ac78fdeb61e7 (patch)
tree769cdc77eec791ff931c93e46363e41843baa86a
parentd6369c9aafc433b08f9bb000142b274738be3fb3 (diff)
downloadmeta-security-9168152b1eae7af3ccdc550eac56ac78fdeb61e7.tar.gz
meta-security-9168152b1eae7af3ccdc550eac56ac78fdeb61e7.tar.bz2
meta-security-9168152b1eae7af3ccdc550eac56ac78fdeb61e7.zip
samhain-server: add volatile file for systemd
Add volatile file to create /var/log/yule when using systemd. Also remove unused /var/log directory in do_install. Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--recipes-ids/samhain/files/samhain-server-volatiles.conf1
-rw-r--r--recipes-ids/samhain/samhain-server.bb16
-rw-r--r--recipes-ids/samhain/samhain.inc2
3 files changed, 15 insertions, 4 deletions
diff --git a/recipes-ids/samhain/files/samhain-server-volatiles.conf b/recipes-ids/samhain/files/samhain-server-volatiles.conf
new file mode 100644
index 0000000..f2ea390
--- /dev/null
+++ b/recipes-ids/samhain/files/samhain-server-volatiles.conf
@@ -0,0 +1 @@
+d /var/log/yule 0775 daemon daemon -
diff --git a/recipes-ids/samhain/samhain-server.bb b/recipes-ids/samhain/samhain-server.bb
index d304912..e7a3aa6 100644
--- a/recipes-ids/samhain/samhain-server.bb
+++ b/recipes-ids/samhain/samhain-server.bb
@@ -4,14 +4,22 @@ require samhain.inc
DEPENDS = "gmp"
-SRC_URI += "file://samhain-server-volatiles"
+SRC_URI += "file://samhain-server-volatiles \
+ file://samhain-server-volatiles.conf \
+ "
TARGET_CC_ARCH += "${LDFLAGS}"
do_install_append() {
- install -d ${D}${sysconfdir}/default/volatiles
- install -m 0644 ${WORKDIR}/samhain-server-volatiles \
- ${D}${sysconfdir}/default/volatiles/samhain-server
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ install -m 0644 ${WORKDIR}/samhain-server-volatiles.conf \
+ ${D}${sysconfdir}/tmpfiles.d/samhain-server.conf
+ else
+ install -d ${D}${sysconfdir}/default/volatiles
+ install -m 0644 ${WORKDIR}/samhain-server-volatiles \
+ ${D}${sysconfdir}/default/volatiles/samhain-server
+ fi
install -m 700 samhain-install.sh init/samhain.startLinux \
init/samhain.startLSB ${D}/var/lib/samhain
diff --git a/recipes-ids/samhain/samhain.inc b/recipes-ids/samhain/samhain.inc
index 91eb697..0a5e432 100644
--- a/recipes-ids/samhain/samhain.inc
+++ b/recipes-ids/samhain/samhain.inc
@@ -159,6 +159,8 @@ do_install_append () {
if [ -d ${D}${localstatedir}/run ]; then
rmdir ${D}${localstatedir}/run
fi
+
+ rm -rf ${D}${localstatedir}/log
}
FILES_${PN} += "${systemd_system_unitdir}"