diff options
-rw-r--r-- | recipes-ids/suricata/files/tmpfiles.suricata | 2 | ||||
-rw-r--r-- | recipes-ids/suricata/suricata_4.1.5.bb | 28 |
2 files changed, 20 insertions, 10 deletions
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 @@ | |||
1 | #Type Path Mode UID GID Age Argument | ||
2 | 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 | |||
6 | 6 | ||
7 | SRC_URI += " \ | 7 | SRC_URI += " \ |
8 | file://volatiles.03_suricata \ | 8 | file://volatiles.03_suricata \ |
9 | file://tmpfiles.suricata \ | ||
9 | file://suricata.yaml \ | 10 | file://suricata.yaml \ |
10 | file://suricata.service \ | 11 | file://suricata.service \ |
11 | file://run-ptest \ | 12 | file://run-ptest \ |
@@ -59,14 +60,19 @@ do_install_append () { | |||
59 | 60 | ||
60 | install -m 0644 ${S}/threshold.config ${D}${sysconfdir}/suricata | 61 | install -m 0644 ${S}/threshold.config ${D}${sysconfdir}/suricata |
61 | 62 | ||
62 | install -d ${D}${systemd_unitdir}/system | 63 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
63 | sed -e s:/etc:${sysconfdir}:g \ | 64 | install -d ${D}${sysconfdir}/tmpfiles.d |
64 | -e s:/var/run:/run:g \ | 65 | install -m 0644 ${WORKDIR}/tmpfiles.suricata ${D}${sysconfdir}/tmpfiles.d/suricata.conf |
65 | -e s:/var:${localstatedir}:g \ | 66 | |
66 | -e s:/usr/bin:${bindir}:g \ | 67 | install -d ${D}${systemd_unitdir}/system |
67 | -e s:/bin/kill:${base_bindir}/kill:g \ | 68 | sed -e s:/etc:${sysconfdir}:g \ |
68 | -e s:/usr/lib:${libdir}:g \ | 69 | -e s:/var/run:/run:g \ |
69 | ${WORKDIR}/suricata.service > ${D}${systemd_unitdir}/system/suricata.service | 70 | -e s:/var:${localstatedir}:g \ |
71 | -e s:/usr/bin:${bindir}:g \ | ||
72 | -e s:/bin/kill:${base_bindir}/kill:g \ | ||
73 | -e s:/usr/lib:${libdir}:g \ | ||
74 | ${WORKDIR}/suricata.service > ${D}${systemd_unitdir}/system/suricata.service | ||
75 | fi | ||
70 | 76 | ||
71 | # Remove /var/run as it is created on startup | 77 | # Remove /var/run as it is created on startup |
72 | rm -rf ${D}${localstatedir}/run | 78 | rm -rf ${D}${localstatedir}/run |
@@ -74,7 +80,9 @@ do_install_append () { | |||
74 | } | 80 | } |
75 | 81 | ||
76 | pkg_postinst_ontarget_${PN} () { | 82 | pkg_postinst_ontarget_${PN} () { |
77 | if [ -e /etc/init.d/populate-volatile.sh ] ; then | 83 | if command -v systemd-tmpfiles >/dev/null; then |
84 | systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/suricata.conf | ||
85 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then | ||
78 | ${sysconfdir}/init.d/populate-volatile.sh update | 86 | ${sysconfdir}/init.d/populate-volatile.sh update |
79 | fi | 87 | fi |
80 | } | 88 | } |
@@ -82,7 +90,7 @@ fi | |||
82 | SYSTEMD_PACKAGES = "${PN}" | 90 | SYSTEMD_PACKAGES = "${PN}" |
83 | 91 | ||
84 | PACKAGES =+ "${PN}-socketcontrol" | 92 | PACKAGES =+ "${PN}-socketcontrol" |
85 | FILES_${PN} += "${systemd_unitdir}" | 93 | FILES_${PN} += "${systemd_unitdir} ${sysconfdir}/tmpfiles.d" |
86 | FILES_${PN}-socketcontrol = "${bindir}/suricatasc ${PYTHON_SITEPACKAGES_DIR}" | 94 | FILES_${PN}-socketcontrol = "${bindir}/suricatasc ${PYTHON_SITEPACKAGES_DIR}" |
87 | 95 | ||
88 | CONFFILES_${PN} = "${sysconfdir}/suricata/suricata.yaml" | 96 | CONFFILES_${PN} = "${sysconfdir}/suricata/suricata.yaml" |