From 64f11c81200d1231abcfc05e6ed806d1432fae96 Mon Sep 17 00:00:00 2001 From: Oier Bravo Urtasun Date: Sun, 24 May 2026 06:05:44 +0200 Subject: [PATCH] feat(build-stack): mDNS preflight warnings (host avahi, dbus, interface count) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When ENABLE_MDNS=true, warn if BASE_DOMAIN isn't .local, host avahi-daemon isn't running, the D-Bus socket is missing, or the host has many interfaces (avahi self-collision risk → suggests allow-interfaces). Co-Authored-By: Claude Opus 4.7 (1M context) --- tooling/build-stack.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tooling/build-stack.sh b/tooling/build-stack.sh index 9eba664..d5a94be 100755 --- a/tooling/build-stack.sh +++ b/tooling/build-stack.sh @@ -116,6 +116,13 @@ up() { *.local) ;; *) warn "ENABLE_MDNS=true but BASE_DOMAIN=$BASE_DOMAIN is not *.local — mDNS won't resolve it" ;; esac + pgrep -x avahi-daemon >/dev/null 2>&1 \ + || warn "host avahi-daemon not detected — the avahi container publishes through it; start it (e.g. 'systemctl start avahi-daemon')" + [ -S /run/dbus/system_bus_socket ] \ + || warn "host D-Bus socket /run/dbus/system_bus_socket missing — avahi publish will fail" + local ifc; ifc=$(ip -o link show 2>/dev/null | wc -l) + [ "${ifc:-0}" -gt 6 ] \ + && warn "host has ${ifc} network interfaces — set 'allow-interfaces=' in /etc/avahi/avahi-daemon.conf, else avahi self-collides (Local name collision)" fi log "PHASE up (mode=$mode${ENABLE_MDNS:+, mdns=$ENABLE_MDNS})" have_script render-config.sh