From: "Armpit" <akuster808@gmail.com>
To: yocto@lists.yoctoproject.org
Cc: Christopher Larson <chris_larson@mentor.com>
Subject: [meta-security][zeus][PATCH 5/9] suricata: add tmpfiles.d config
Date: Sun, 5 Jan 2020 15:18:26 -0800 [thread overview]
Message-ID: <20200105231830.5281-5-akuster808@gmail.com> (raw)
In-Reply-To: <20200105231830.5281-1-akuster808@gmail.com>
From: Christopher Larson <chris_larson@mentor.com>
This is needed to ensure our /var/log directory is created when using
systemd.
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
---
recipes-ids/suricata/files/tmpfiles.suricata | 2 ++
recipes-ids/suricata/suricata_4.1.5.bb | 28 +++++++++++++-------
2 files changed, 20 insertions(+), 10 deletions(-)
create mode 100644 recipes-ids/suricata/files/tmpfiles.suricata
diff --git a/recipes-ids/suricata/files/tmpfiles.suricata b/recipes-ids/suricata/files/tmpfiles.suricata
new file mode 100644
index 0000000..fbf3784
--- /dev/null
+++ b/recipes-ids/suricata/files/tmpfiles.suricata
@@ -0,0 +1,2 @@
+#Type Path Mode UID GID Age Argument
+d /var/log/suricata 0755 root root
diff --git a/recipes-ids/suricata/suricata_4.1.5.bb b/recipes-ids/suricata/suricata_4.1.5.bb
index e15a9a3..b2700d6 100644
--- a/recipes-ids/suricata/suricata_4.1.5.bb
+++ b/recipes-ids/suricata/suricata_4.1.5.bb
@@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;beginline=1;endline=2;md5=c70d8d3310941dcdfcd
SRC_URI += " \
file://volatiles.03_suricata \
+ file://tmpfiles.suricata \
file://suricata.yaml \
file://suricata.service \
file://run-ptest \
@@ -59,14 +60,19 @@ do_install_append () {
install -m 0644 ${S}/threshold.config ${D}${sysconfdir}/suricata
- install -d ${D}${systemd_unitdir}/system
- sed -e s:/etc:${sysconfdir}:g \
- -e s:/var/run:/run:g \
- -e s:/var:${localstatedir}:g \
- -e s:/usr/bin:${bindir}:g \
- -e s:/bin/kill:${base_bindir}/kill:g \
- -e s:/usr/lib:${libdir}:g \
- ${WORKDIR}/suricata.service > ${D}${systemd_unitdir}/system/suricata.service
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ install -m 0644 ${WORKDIR}/tmpfiles.suricata ${D}${sysconfdir}/tmpfiles.d/suricata.conf
+
+ install -d ${D}${systemd_unitdir}/system
+ sed -e s:/etc:${sysconfdir}:g \
+ -e s:/var/run:/run:g \
+ -e s:/var:${localstatedir}:g \
+ -e s:/usr/bin:${bindir}:g \
+ -e s:/bin/kill:${base_bindir}/kill:g \
+ -e s:/usr/lib:${libdir}:g \
+ ${WORKDIR}/suricata.service > ${D}${systemd_unitdir}/system/suricata.service
+ fi
# Remove /var/run as it is created on startup
rm -rf ${D}${localstatedir}/run
@@ -74,7 +80,9 @@ do_install_append () {
}
pkg_postinst_ontarget_${PN} () {
-if [ -e /etc/init.d/populate-volatile.sh ] ; then
+if command -v systemd-tmpfiles >/dev/null; then
+ systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/suricata.conf
+elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
${sysconfdir}/init.d/populate-volatile.sh update
fi
}
@@ -82,7 +90,7 @@ fi
SYSTEMD_PACKAGES = "${PN}"
PACKAGES =+ "${PN}-socketcontrol"
-FILES_${PN} += "${systemd_unitdir}"
+FILES_${PN} += "${systemd_unitdir} ${sysconfdir}/tmpfiles.d"
FILES_${PN}-socketcontrol = "${bindir}/suricatasc ${PYTHON_SITEPACKAGES_DIR}"
CONFFILES_${PN} = "${sysconfdir}/suricata/suricata.yaml"
--
2.17.1
next prev parent reply other threads:[~2020-01-05 23:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-05 23:18 [meta-security][zeus][PATCH 1/9] cryptsetup tpm incubator: fix installed vs shipped Armpit
2020-01-05 23:18 ` [meta-security][zeus][PATCH 2/9] meta-tpm/recipes-tpm2/tpm2-tss/tpm2-tss_2.3.1.bb: add new udev dir to FILES and append EXTRA_OECONF Armpit
2020-01-05 23:18 ` [meta-security][zeus][PATCH 3/9] checksecurity: use more portable find args Armpit
2020-01-05 23:18 ` [meta-security][zeus][PATCH 4/9] clamav: add tmpfiles.d config Armpit
2020-01-05 23:18 ` Armpit [this message]
2020-01-05 23:18 ` [meta-security][zeus][PATCH 6/9] README: update mailing list to new groups.io Armpit
2020-01-05 23:18 ` [meta-security][zeus][PATCH 7/9] libseccomp: upgrade 2.4.1 -> 2.4.2 Armpit
2020-01-05 23:18 ` [meta-security][zeus][PATCH 8/9] libhtp: bugfix only update 0.5.32 Armpit
2020-01-05 23:18 ` [meta-security][zeus][PATCH 9/9] suricata: update to 4.1.6 Armpit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200105231830.5281-5-akuster808@gmail.com \
--to=akuster808@gmail.com \
--cc=chris_larson@mentor.com \
--cc=yocto@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox