Introduction to Avahi
The Avahi package is a system which
facilitates service discovery on a local network.
This package is known to build and work properly
using an LFS 12.4 platform.
Package Information
Additional Downloads
Avahi Dependencies
Required
GLib-2.86.2 (GObject Introspection recommended)
Recommended
GTK-3.24.51 and
libdaemon-0.14
Optional
libevent-2.1.12,
and
xmltoman
(for generating documentation)
Installation of Avahi
There should be a dedicated user and group to take control
of the avahi-daemon daemon after it is
started. Issue the following commands as the
root user:
groupadd -fg 84 avahi
useradd -c "Avahi Daemon Owner" -d /run/avahi-daemon -u 84 \
-g avahi -s /bin/false avahi
There should also be a dedicated privileged access group for
Avahi clients. Issue the following command as
the root user:
groupadd -fg 86 netdev
Fix a regression that results in a race condition when IPv6 is in use
and multiple network adapters are present on the system:
patch -Np1 -i ../avahi-0.8-ipv6_race_condition_fix-1.patch
Fix a security vulnerability in avahi-daemon:
sed -i '426a if (events & AVAHI_WATCH_HUP) { \
client_free(c); \
return; \
}' avahi-daemon/simple-protocol.c
Prepare Avahi by running the following
commands:
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-static \
--disable-libevent \
--disable-mono \
--disable-monodoc \
--disable-python \
--disable-qt3 \
--disable-qt4 \
--disable-qt5 \
--enable-core-docs \
--with-distro=none \
--with-dbus-system-address='unix:path=/run/dbus/system_bus_socket'
Now Build the package, issue:
make
This package does not come with a test suite.
Now Install the package, as the root user:
make install
Command Explanations
--disable-static: This switch prevents
installation of static versions of the libraries.
--disable-libevent: This parameter disables the
use of libevent-2.1.12. Remove if you have it installed.
--disable-mono: This parameter disables the
Mono bindings.
--disable-monodoc: This parameter disables
documentation for the Mono bindings.
--disable-python: This parameter disables the
scripts that depend on Python. It also
allows a regular install to complete successfully.
--disable-qt3: This parameter disables the
attempt to build the obsolete Qt3
portions of the package.
--disable-qt4: This parameter disables the
attempt to build the obsolete Qt4Core
portions of the package.
--enable-core-docs: This parameter enables the
building of documentation.
--with-distro=none: There is an obsolete
boot script in the distribution for LFS. This option disables it.
--with-dbus-system-address=: This option
prevents the package from referring to the deprecated
/var/run directory.
--disable-dbus: This parameter disables the use
of D-Bus.
--disable-gtk: This parameter disables the use
of GTK+2.
--disable-gtk3: This parameter disables the use
of GTK+3.
--disable-qt5: This parameter disables
the use of Qt5, and allows
building without it.
--disable-libdaemon: This parameter disables the use
of libdaemon. If you use this option,
avahi-daemon won't be built.
--enable-tests: This option enables the building of
tests and examples.
--enable-compat-howl: This option enables the
compatibility layer for HOWL.
--enable-compat-libdns_sd: This option enables the
compatibility layer for libdns_sd.
Configuring avahi
Boot Script
The avahi-daemon will conflict with
systemd-resolved under the default configuration
if both are running simultaneously on a system because both will
act as a Multicast DNS resolver and responder. If you must run the
Avahi daemon (the BLFS editors don't recommend to do that unless
you really need its functionality), disable the Multicast DNS
support of systemd-resolved and enable
the previously installed systemd unit by running the following command
as the root user:
mkdir -pv /etc/systemd/resolved.conf.d
cat > /etc/systemd/resolved.conf.d/no-mdns.conf << EOF
[Resolve]
MulticastDNS=no
EOF
systemctl enable avahi-daemon
To start the avahi-dnsconfd daemon at boot, enable
the previously installed systemd unit by running the following command
as the root user (note that the following command will also implicitly
enable avahi-daemon, so if you are running it, you need
to make sure you've disabled the systemd-resolved
Multicast DNS support as mentioned above):
systemctl enable avahi-dnsconfd