diff options
| author | Haixiao Yan <haixiao.yan.cn@windriver.com> | 2025-10-27 16:45:13 +0800 |
|---|---|---|
| committer | Scott Murray <scott.murray@konsulko.com> | 2025-11-12 14:17:55 -0500 |
| commit | dec36ead2ebee374c542a70e4f0e9177443dbd48 (patch) | |
| tree | 48f78c558e8e89c362b27e0104ce256ed13ec577 | |
| parent | b639be32ad038d49091ddc1ae1aaf3e2c7e5bbc5 (diff) | |
| download | meta-security-dec36ead2ebee374c542a70e4f0e9177443dbd48.tar.gz | |
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 <haixiao.yan.cn@windriver.com>
| -rw-r--r-- | dynamic-layers/meta-python/recipes-security/fail2ban/python3-fail2ban_git.bb | 3 |
1 files changed, 3 insertions, 0 deletions
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 4238c9f..cb7a4ad 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 | |||
| @@ -40,6 +40,7 @@ do_install:append () { | |||
| 40 | 40 | ||
| 41 | chown -R root:root ${D}/${bindir} | 41 | chown -R root:root ${D}/${bindir} |
| 42 | rm -rf ${D}/run | 42 | rm -rf ${D}/run |
| 43 | find ${D}${sysconfdir} -type f -exec sed -i '1s/env fail2ban-python/env python3/' {} + | ||
| 43 | } | 44 | } |
| 44 | 45 | ||
| 45 | do_install_ptest:append () { | 46 | do_install_ptest:append () { |
| @@ -57,6 +58,8 @@ do_install_ptest:append () { | |||
| 57 | install -m 0644 ${S}/README.md ${D}${PTEST_PATH} | 58 | install -m 0644 ${S}/README.md ${D}${PTEST_PATH} |
| 58 | sed -i -e 's|^logpath = README.md|logpath = ${PTEST_PATH}/README.md|g' \ | 59 | sed -i -e 's|^logpath = README.md|logpath = ${PTEST_PATH}/README.md|g' \ |
| 59 | ${D}${PYTHON_SITEPACKAGES_DIR}/fail2ban/tests/config/jail.conf | 60 | ${D}${PYTHON_SITEPACKAGES_DIR}/fail2ban/tests/config/jail.conf |
| 61 | find ${D}${PYTHON_SITEPACKAGES_DIR} -type f -exec sed -i \ | ||
| 62 | '1s/env fail2ban-python/env python3/' {} + | ||
| 60 | } | 63 | } |
| 61 | 64 | ||
| 62 | INITSCRIPT_PACKAGES = "${PN}" | 65 | INITSCRIPT_PACKAGES = "${PN}" |
