From 31b70d93fcfac878caa2903c99b5b7f610befa35 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Wed, 4 Oct 2023 22:51:09 +0200 Subject: 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 Signed-off-by: Armin Kuster --- .../recipes-security/fail2ban/python3-fail2ban_1.0.2.bb | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 \ UPSTREAM_CHECK_GITTAGREGEX = "(?P\d+(\.\d+)+)" inherit update-rc.d ptest setuptools3_legacy +inherit systemd + +SYSTEMD_SERVICE:${PN} = "fail2ban.service" S = "${WORKDIR}/git" @@ -38,6 +41,12 @@ do_install:append () { install -d ${D}/${sysconfdir}/fail2ban install -d ${D}/${sysconfdir}/init.d install -m 0755 ${WORKDIR}/initd ${D}${sysconfdir}/init.d/fail2ban-server + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${B}/fail2ban.service ${D}${systemd_system_unitdir} + fi + chown -R root:root ${D}/${bindir} rm -rf ${D}/run } @@ -60,3 +69,4 @@ INSANE_SKIP:${PN}:append = "already-stripped" RDEPENDS:${PN} = "${VIRTUAL-RUNTIME_base-utils-syslog} iptables sqlite3 python3-core python3-pyinotify" RDEPENDS:${PN} += " python3-logging python3-fcntl python3-json" RDEPENDS:${PN}-ptest = "python3-core python3-io python3-modules python3-fail2ban" + -- cgit v1.2.3-54-g00ecf