I'm using vanilla-sources 3.4 series. Since net-dns/avahi-0.6.31-r2 was stabilized into bug #476184, avahi-daemon service fails to start with : > avahi-daemon[3239]: SO_REUSEPORT failed: Protocol not available > avahi-daemon[3239]: Failed to create server: No suitable network protocol available From $URL I learned that I need a kernel >= 3.9. This should be handled by the ebuild. Thanks. Reproducible: Always
Also from $URL : > Go edit /etc/avahi/avahi-daemon.conf > > Find the line: > "#disallow-other-stacks=no" > and change to > "disallow-other-stacks=yes" > This flag is apparently what now causes avahi to attempt to use SO_REUSEPORT > (and turning it to yes disables this new behavior.) The docs indicate this is > some mechanism to accomodate nasty setups with more than one mdns handler on > them at the same time. This allows the daemon to start without upgrading the kernel. Maybe this should be pointed out by a warning.
Actually that seems to be not related to Avahi ebuild at all. I've just updated my system and it suddenly got broken. ~~~~~ <...> Sep 14 21:44:34 kirNote avahi-daemon[3031]: Found user 'avahi' (UID 109) and group 'avahi' (GID 990). Sep 14 21:44:34 kirNote avahi-daemon[3031]: Successfully dropped root privileges. Sep 14 21:44:34 kirNote avahi-daemon[3031]: avahi-daemon 0.6.31 starting up. Sep 14 21:44:47 kirNote avahi-daemon[3031]: Successfully called chroot(). Sep 14 21:44:48 kirNote avahi-daemon[3031]: Successfully dropped remaining capabilities. Sep 14 21:44:48 kirNote avahi-daemon[3031]: Loading service file /services/sftp-ssh.service. Sep 14 21:44:48 kirNote avahi-daemon[3031]: Loading service file /services/ssh.service. Sep 14 21:44:48 kirNote avahi-daemon[3031]: Network interface enumeration completed. Sep 14 21:44:48 kirNote avahi-daemon[3031]: Registering HINFO record with values 'X86_64'/'LINUX'. Sep 14 21:44:48 kirNote avahi-daemon[3031]: Server startup complete. Host name is kirNote.local. Local service cookie is 2364388216. Sep 14 21:44:48 kirNote avahi-daemon[3031]: Service "kirNote" (/services/ssh.service) successfully established. Sep 14 21:44:48 kirNote avahi-daemon[3031]: Service "kirNote" (/services/sftp-ssh.service) successfully established. <...> -- Reboot -- <...> Sep 15 21:39:25 kirNote systemd[1]: Starting Avahi mDNS/DNS-SD Stack... Sep 15 21:39:27 kirNote avahi-daemon[3161]: Found user 'avahi' (UID 109) and group 'avahi' (GID 990). Sep 15 21:39:27 kirNote avahi-daemon[3161]: Successfully dropped root privileges. Sep 15 21:39:27 kirNote avahi-daemon[3161]: avahi-daemon 0.6.31 starting up. Sep 15 21:39:30 kirNote avahi-daemon[3161]: Successfully called chroot(). Sep 15 21:39:30 kirNote avahi-daemon[3161]: Successfully dropped remaining capabilities. Sep 15 21:39:40 kirNote avahi-daemon[3161]: Loading service file /services/sftp-ssh.service. Sep 15 21:39:40 kirNote systemd[1]: Started Avahi mDNS/DNS-SD Stack. Sep 15 21:39:40 kirNote avahi-daemon[3161]: Loading service file /services/ssh.service. Sep 15 21:39:40 kirNote avahi-daemon[3161]: SO_REUSEPORT failed: Protocol not available Sep 15 21:39:40 kirNote systemd[1]: avahi-daemon.service: main process exited, code=exited, status=255/n/a Sep 15 21:39:40 kirNote systemd[1]: Unit avahi-daemon.service entered failed state. ~~~~~ So, as you can see, Avahi version is the same. Even downgrading to 0.6.30-r3 doesn't help. I'm not sure what caused this behaviour. I haven't upgraded kernel for quite a while and it's gentoo-sources-3.8.8.
Hm, I guess that some headers got updated and that triggered `#ifdef SO_REUSEPORT` in `avahi-core/socket.c`. Setting `disallow-other-stacks=yes` in `avahi-daemon.conf` helps.
I can confirm this bug. (In reply to Kirill Elagin from comment #3) > Setting `disallow-other-stacks=yes` in `avahi-daemon.conf` helps. Yes, this workaround helps. Another solution: mask >=sys-kernel/linux-headers-3.9 if you use older kernel.
(In reply to Alexander Tsoy from comment #4) > Another solution: mask >=sys-kernel/linux-headers-3.9 if you use older > kernel. And rebuild avahi of course.
should be all set now in the tree; thanks for the report! Commit message: Add patch from Debian to fix running on older kernels w/newer kernel headers http://sources.gentoo.org/net-dns/avahi/avahi-0.6.31-r4.ebuild?rev=1.1 http://sources.gentoo.org/net-dns/avahi/files/avahi-0.6.31-so_reuseport-may-not-exist-in-running-kernel.patch?rev=1.1