TritonDataCenter / smartos-live

For more information, please see http://smartos.org/ For any questions that aren't answered there, please join the SmartOS discussion list: https://smartos.topicbox.com/groups/smartos-discuss
1.58k stars 248 forks source link

Avahi on Ubuntu 16.04 fails to bind #669

Open ismell opened 8 years ago

ismell commented 8 years ago

I'm running Ubuntu 16.04 20160601 on a smartos box.

When I try and start the avahi-daemon with the default parameters it fails:

root@ubuntu:/etc/systemd# /usr/sbin/avahi-daemon --debug
Process 62994 died: No such process; trying to remove PID file. (/var/run/avahi-daemon//pid)
Found user 'avahi' (UID 108) and group 'avahi' (GID 112).
Successfully dropped root privileges.
avahi-daemon 0.6.32-rc starting up.
chroot.c: chroot() helper started
Successfully called chroot().
Successfully dropped remaining capabilities.
Failed to initialize inotify: No such file or directory
chroot.c: chroot() helper got command 02
No service file found in /etc/avahi/services.
SO_REUSEPORT failed: Protocol not available
SO_REUSEPORT failed: Protocol not available
netlink.c: bind(): Permission denied
on: starting up: iface-linux.c:380: avahi_interface_monitor_sync: Assertion `m' failed.
chroot.c: chroot() helper exiting with return value 0
Aborted (core dumped)

When I start it up with root privileges it works just fine:

root@ubuntu:/etc/systemd# /usr/sbin/avahi-daemon --debug --no-drop-root
Process 63008 died: No such process; trying to remove PID file. (/var/run/avahi-daemon//pid)
avahi-daemon 0.6.32-rc starting up.
No service file found in /etc/avahi/services.
SO_REUSEPORT failed: Protocol not available
SO_REUSEPORT failed: Protocol not available
Joining mDNS multicast group on interface eth0.IPv6 with address fe80::d048:92ff:fea6:b27f.
IPV6_ADD_MEMBERSHIP failed: Protocol not available
Joining mDNS multicast group on interface eth0.IPv4 with address 10.0.0.11.
New relevant interface eth0.IPv4 for mDNS.
Network interface enumeration completed.
Registering new address record for fe80::d048:92ff:fea6:b27f on eth0.*.
Registering new address record for 10.0.0.11 on eth0.IPv4.
Unhandled cmsg_type: 0
Unhandled cmsg_type: 0
Unhandled cmsg_type: 0
Server startup complete. Host name is ubuntu.local. Local service cookie is 1360304338.
Unhandled cmsg_type: 0
Unhandled cmsg_type: 0
Unhandled cmsg_type: 0
Unhandled cmsg_type: 0

I can add more debug information if that would be helpful.
- SmartOS (build: 20161013T025521Z)
bahamat commented 7 years ago

Is this still an issue? I'm not able to reproduce this running avahi-daemon on lx Ubuntu 14.04 with PI 20170413.

ismell commented 7 years ago

I'll try again. I think avahi added a chroot helper that might have fixed it.

ismell commented 7 years ago

Looks like it starts up now

root@irc:~# /usr/sbin/avahi-daemon --debug
Process 6510 died: No such process; trying to remove PID file. (/var/run/avahi-daemon//pid)
Found user 'avahi' (UID 108) and group 'avahi' (GID 112).
Successfully dropped root privileges.
avahi-daemon 0.6.32-rc starting up.
chroot.c: chroot() helper started
Successfully called chroot().
Successfully dropped remaining capabilities.
Failed to initialize inotify: No such file or directory
chroot.c: chroot() helper got command 02
No service file found in /etc/avahi/services.
SO_REUSEPORT failed: Protocol not available
SO_REUSEPORT failed: Protocol not available
Joining mDNS multicast group on interface eth0.IPv6 with address fe80::30bc:9bff:fe3a:732.
New relevant interface eth0.IPv6 for mDNS.
Joining mDNS multicast group on interface eth0.IPv4 with address 10.0.0.13.
New relevant interface eth0.IPv4 for mDNS.
Network interface enumeration completed.
Registering new address record for fe80::30bc:9bff:fe3a:732 on eth0.*.
Registering new address record for 10.0.0.13 on eth0.IPv4.
Unhandled cmsg_type: 0
Unhandled cmsg_type: 0
Unhandled cmsg_type: 0
Server startup complete. Host name is irc.local. Local service cookie is 1830963552.
Unhandled cmsg_type: 0
Unhandled cmsg_type: 0
Unhandled cmsg_type: 0
Unhandled cmsg_type: 0

Running it with --no-chroot does fix the inotify errors, so not sure if chroot and inotify are messed up on the kernel side or in avahi:

root@irc:~# /usr/sbin/avahi-daemon --debug --no-chroot
Found user 'avahi' (UID 108) and group 'avahi' (GID 112).
Successfully dropped root privileges.
avahi-daemon 0.6.32-rc starting up.
No service file found in /etc/avahi/services.
SO_REUSEPORT failed: Protocol not available
SO_REUSEPORT failed: Protocol not available
Joining mDNS multicast group on interface eth0.IPv6 with address fe80::30bc:9bff:fe3a:732.
New relevant interface eth0.IPv6 for mDNS.
Joining mDNS multicast group on interface eth0.IPv4 with address 10.0.0.13.
New relevant interface eth0.IPv4 for mDNS.
Network interface enumeration completed.
Registering new address record for fe80::30bc:9bff:fe3a:732 on eth0.*.
Registering new address record for 10.0.0.13 on eth0.IPv4.
Unhandled cmsg_type: 0
Unhandled cmsg_type: 0
Unhandled cmsg_type: 0
Server startup complete. Host name is irc.local. Local service cookie is 596172168.
Unhandled cmsg_type: 0
Unhandled cmsg_type: 0
^CGot SIGINT, quitting.
Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::30bc:9bff:fe3a:732.
Leaving mDNS multicast group on interface eth0.IPv4 with address 10.0.0.13.
avahi-daemon 0.6.32-rc exiting.
krital commented 7 years ago

any progress on this? Despite the Unhanded msg_type: 0 messages and the fact i don't see the zone in bonjour, i can still mount it using afp:// and seems to work, not sure about stability yet.