From 4c8212c19ff9482f97abaff6d5d7a93531c2ea89 Mon Sep 17 00:00:00 2001 From: Haixiao Yan Date: Fri, 24 Oct 2025 19:09:54 +0800 Subject: [PATCH] fail2ban: replace fail2ban-python shebang with python3 In Yocto, there is only one Python interpreter (python3), and the auto-generated "fail2ban-python" symlink is not used. To ensure all installed scripts can run correctly, replace the shebang line from "#!/usr/bin/env fail2ban-python" to "#!/usr/bin/env python3" during installation. Signed-off-by: Haixiao Yan Signed-off-by: Scott Murray --- .../recipes-security/fail2ban/python3-fail2ban_git.bb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dynamic-layers/meta-python/recipes-security/fail2ban/python3-fail2ban_git.bb b/dynamic-layers/meta-python/recipes-security/fail2ban/python3-fail2ban_git.bb index 72a932b..e95048f 100644 --- a/dynamic-layers/meta-python/recipes-security/fail2ban/python3-fail2ban_git.bb +++ b/dynamic-layers/meta-python/recipes-security/fail2ban/python3-fail2ban_git.bb @@ -44,6 +44,7 @@ do_install:append () { chown -R root:root ${D}/${bindir} rm -rf ${D}/run + find ${D}${sysconfdir} -type f -exec sed -i '1s/env fail2ban-python/env python3/' {} + } do_install_ptest:append () { @@ -61,6 +62,8 @@ do_install_ptest:append () { install -m 0644 ${S}/README.md ${D}${PTEST_PATH} sed -i -e 's|^logpath = README.md|logpath = ${PTEST_PATH}/README.md|g' \ ${D}${PYTHON_SITEPACKAGES_DIR}/fail2ban/tests/config/jail.conf + find ${D}${PYTHON_SITEPACKAGES_DIR} -type f -exec sed -i \ + '1s/env fail2ban-python/env python3/' {} + } INITSCRIPT_PACKAGES = "${PN}"