Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 484212 - net-dns/avahi-0.6.31-r2 with kernel <3.9 - avahi-daemon[3239]: SO_REUSEPORT failed: Protocol not available
Summary: net-dns/avahi-0.6.31-r2 with kernel <3.9 - avahi-daemon[3239]: SO_REUSEPORT f...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL: http://forums.gentoo.org/viewtopic-p-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-08 09:39 UTC by Fab
Modified: 2014-02-09 00:48 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fab 2013-09-08 09:39:43 UTC
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
Comment 1 Fab 2013-09-08 16:26:03 UTC
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.
Comment 2 Kirill Elagin 2013-09-15 18:48:10 UTC
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.
Comment 3 Kirill Elagin 2013-09-15 18:51:53 UTC
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.
Comment 4 Alexander Tsoy 2013-10-06 12:40:37 UTC
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.
Comment 5 Alexander Tsoy 2013-10-06 12:45:17 UTC
(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.
Comment 6 SpanKY gentoo-dev 2014-02-09 00:48:22 UTC
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