summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>2023-10-04 22:51:09 +0200
committerArmin Kuster <akuster808@gmail.com>2023-10-08 15:24:27 -0400
commit31b70d93fcfac878caa2903c99b5b7f610befa35 (patch)
tree8efd955f39bd5ceac40d6dda4938ceffadef8b70
parentaca6d4a9e7c45cb44ac02062c2750cdfa1679cc6 (diff)
downloadmeta-security-31b70d93fcfac878caa2903c99b5b7f610befa35.tar.gz
fail2ban: add systemd support
fail2ban ships with a suitable .service file, so install that if systemd is in DISTRO_FEATURES. The logic in rm_sysvinit_initddir in systemd.bbclass will then take care of removing the sysvinit script if sysvinit is not in DISTRO_FEATURES. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--dynamic-layers/meta-python/recipes-security/fail2ban/python3-fail2ban_1.0.2.bb10
1 files changed, 10 insertions, 0 deletions
diff --git a/dynamic-layers/meta-python/recipes-security/fail2ban/python3-fail2ban_1.0.2.bb b/dynamic-layers/meta-python/recipes-security/fail2ban/python3-fail2ban_1.0.2.bb
index 9379494..81fa00d 100644
--- a/dynamic-layers/meta-python/recipes-security/fail2ban/python3-fail2ban_1.0.2.bb
+++ b/dynamic-layers/meta-python/recipes-security/fail2ban/python3-fail2ban_1.0.2.bb
@@ -20,6 +20,9 @@ SRC_URI = "git://github.com/fail2ban/fail2ban.git;branch=master;protocol=https \
20UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)" 20UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
21 21
22inherit update-rc.d ptest setuptools3_legacy 22inherit update-rc.d ptest setuptools3_legacy
23inherit systemd
24
25SYSTEMD_SERVICE:${PN} = "fail2ban.service"
23 26
24S = "${WORKDIR}/git" 27S = "${WORKDIR}/git"
25 28
@@ -38,6 +41,12 @@ do_install:append () {
38 install -d ${D}/${sysconfdir}/fail2ban 41 install -d ${D}/${sysconfdir}/fail2ban
39 install -d ${D}/${sysconfdir}/init.d 42 install -d ${D}/${sysconfdir}/init.d
40 install -m 0755 ${WORKDIR}/initd ${D}${sysconfdir}/init.d/fail2ban-server 43 install -m 0755 ${WORKDIR}/initd ${D}${sysconfdir}/init.d/fail2ban-server
44
45 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
46 install -d ${D}${systemd_system_unitdir}
47 install -m 0644 ${B}/fail2ban.service ${D}${systemd_system_unitdir}
48 fi
49
41 chown -R root:root ${D}/${bindir} 50 chown -R root:root ${D}/${bindir}
42 rm -rf ${D}/run 51 rm -rf ${D}/run
43} 52}
@@ -60,3 +69,4 @@ INSANE_SKIP:${PN}:append = "already-stripped"
60RDEPENDS:${PN} = "${VIRTUAL-RUNTIME_base-utils-syslog} iptables sqlite3 python3-core python3-pyinotify" 69RDEPENDS:${PN} = "${VIRTUAL-RUNTIME_base-utils-syslog} iptables sqlite3 python3-core python3-pyinotify"
61RDEPENDS:${PN} += " python3-logging python3-fcntl python3-json" 70RDEPENDS:${PN} += " python3-logging python3-fcntl python3-json"
62RDEPENDS:${PN}-ptest = "python3-core python3-io python3-modules python3-fail2ban" 71RDEPENDS:${PN}-ptest = "python3-core python3-io python3-modules python3-fail2ban"
72