Avahi on Arch linux ARM
From wikipedia: Avahi is a FLOSS Zero-configuration networking (zeroconf) implementation, including a system for multicast DNS/DNS-SD service discovery.
Long story short: Avahi is used to resolve hostnames of LAN devices.
I happen to have an ARM box on which runs a pretty minimal Arch Linux installation.
Installing Avahi is pretty easy:
[root@k* ~]# pacman -S avahi nss-mdns
The latest version of Avahi (0.6.31-11) makes use of SO_REUSEPORT which is a new feature introduced in Linux kernel 3.9, the latest official Arch Linux kernel for my platform is 3.8.13.19-2-ARCH so when I try to start the service systemd reports the following error:
[root@k* ~]# systemctl status avahi-daemon.service -l
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; disabled)
Active: failed (Result: exit-code) since Fri 2014-04-04 00:06:53 CEST; 27s ago
Process: 829 ExecStart=/usr/bin/avahi-daemon -s (code=exited, status=255)
Main PID: 829 (code=exited, status=255)
Status: "avahi-daemon 0.6.31 starting up."
Apr 04 00:06:53 kike avahi-daemon[829]: Found user 'avahi' (UID 84) and group 'avahi' (GID 84).
Apr 04 00:06:53 kike avahi-daemon[829]: Successfully dropped root privileges.
Apr 04 00:06:53 kike avahi-daemon[829]: avahi-daemon 0.6.31 starting up.
Apr 04 00:06:53 kike avahi-daemon[829]: WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
Apr 04 00:06:53 kike systemd[1]: Started Avahi mDNS/DNS-SD Stack.
Apr 04 00:06:53 kike avahi-daemon[829]: Successfully called chroot().
Apr 04 00:06:53 kike avahi-daemon[829]: Successfully dropped remaining capabilities.
Apr 04 00:06:53 kike avahi-daemon[829]: Loading service file /services/sftp-ssh.service.
Apr 04 00:06:53 kike systemd[1]: avahi-daemon.service: main process exited, code=exited, status=255/n/a
Apr 04 00:06:53 kike systemd[1]: Unit avahi-daemon.service entered failed state.
Luckily there is a workaround to make the latest version of Avahi work even with an old kernel.
Edit the following file, find the line disallow-other-stacks
and set it to yes
, then restart avahi-daemon and it should be finally working:
[root@k* ~]# vi /etc/avahi/avahi-daemon.conf
disallow-other-stacks=yes
[root@k* ~]# systemctl restart avahi-daemon && systemctl status avahi-daemon