diff mbox series

rpcbind: Remove IPv6 listener, if ipv6 not in DISTRO_FEATURES

Message ID e9812d801976eeb3dfe0571f08f6366e1c17214a.1774732383.git.joerg.sommer@navimatix.de
State New
Headers show
Series rpcbind: Remove IPv6 listener, if ipv6 not in DISTRO_FEATURES | expand

Commit Message

Jörg Sommer March 28, 2026, 9:13 p.m. UTC
From: Jörg Sommer <joerg.sommer@navimatix.de>

Remove in all systemd socket files all Listen on IPv6 addresses, if IPv6 is
not available. Otherwise systemd warns about "Binding to IPv6 address not
available since kernel does not support IPv6."

Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
---
 meta/recipes-extended/rpcbind/rpcbind_1.2.8.bb | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-extended/rpcbind/rpcbind_1.2.8.bb b/meta/recipes-extended/rpcbind/rpcbind_1.2.8.bb
index bcdadf4f10..bd8ba1e88a 100644
--- a/meta/recipes-extended/rpcbind/rpcbind_1.2.8.bb
+++ b/meta/recipes-extended/rpcbind/rpcbind_1.2.8.bb
@@ -54,6 +54,11 @@  do_install:append () {
 
 	install -d ${D}${systemd_system_unitdir}/rpcbind.service.d
 	install -m 0644 ${UNPACKDIR}/rpcbind.systemd ${D}${systemd_system_unitdir}/rpcbind.service.d/rpcbind.conf
+
+	if ! ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'true', 'false', d)}
+	then
+		sed -i '/^Listen.*=\[.*\]/s/^/# /' ${D}${systemd_system_unitdir}/*.socket
+	fi
 }
 
 FILES:${PN} += "${systemd_system_unitdir}/rpcbind.service.d/rpcbind.conf"