Ubuntu avahi守护进程无法注册服务I';m使用avahi发布服务发布
偶尔,我会注意到我无法检测到我在Ubuntu上通过avahi(你好)发布的服务。例如,avahi browse-a不显示已发布的服务,浏览器也不解析已发布的.local主机名。在服务器端,我注意到Ubuntu avahi守护进程无法注册服务I';m使用avahi发布服务发布,ubuntu,networking,bonjour,avahi,Ubuntu,Networking,Bonjour,Avahi,偶尔,我会注意到我无法检测到我在Ubuntu上通过avahi(你好)发布的服务。例如,avahi browse-a不显示已发布的服务,浏览器也不解析已发布的.local主机名。在服务器端,我注意到ps的输出表明avahi守护进程在注册服务时遇到了问题: ubuntu@node3:~$ ps aux | grep [a]vahi root 26584 0.0 0.0 4204 356 ? S 19:21 0:00 supervise avahi ubun
ps
的输出表明avahi守护进程
在注册服务时遇到了问题:
ubuntu@node3:~$ ps aux | grep [a]vahi
root 26584 0.0 0.0 4204 356 ? S 19:21 0:00 supervise avahi
ubuntu 26598 0.0 0.0 4216 352 ? S 19:21 0:00 multilog s8388608 n10 /var/log/avahi
avahi 28332 0.0 0.0 32352 1636 ? S 20:19 0:00 avahi-daemon: registering [node3-44.local]
avahi 28333 0.0 0.0 32224 468 ? S 20:19 0:00 avahi-daemon: chroot helper
root 28338 0.0 0.0 17192 1028 ? S 20:19 0:00 avahi-publish-service -as node3 _foobar._tcp 8080
以下是“取消锁定”主机上此命令的输出:
我确实看到了这件旧的,可能是相关的。有时杀死
avahi守护进程似乎可以暂时解决问题。此外,重新启动卡住的机器的一次尝试也成功了。然而,我想了解为什么会发生这种情况,以及我如何以最稳健的方式处理这个问题。有什么想法吗?我注意到201号票在Avahi网站上已经存在了一段时间。虽然我甚至不能在那里注册。。。看起来这个项目的开发进度已经下降了。我们遇到了类似的问题。以下内容(为我们)说明了这一点:
diff——git a/avahi core/server.c b/avahi core/server.c
索引69a1d02..03d4fc1 100644
---a/avahi core/server.c
+++b/avahi core/server.c
@@-1216,8+1216,8@@static void register\u browse\u domain(AvahiServer*s){
静态无效寄存器(AvahiServer*s){
断言;
-服务器设置状态(s、AVAHI服务器注册);
s->n_host_rr_pending++/**确保状态没有更改,tp AVAHI_SERVER_运行得太早*/
+服务器设置状态(s、AVAHI服务器注册);
登记册(s);
注册\u浏览\u域;
我有一个类似的问题,写了一篇文章,为我解决了这个问题
在一个例子中,我将补丁与bug 201关联起来
更新:
我已经在多台设备上运行了一年多的avahi daemon补丁版本。这些设备通常会重新启动、断开连接/重新连接到网络。应用补丁后,这些设备从未停止注册,我们也没有遇到任何奇怪的副作用。在添加之前,我也遇到过同样的问题allow interfaces=
在avahi-daemon.conf中。你能告诉我你测试这个的范围有多广吗?这将有助于集成补丁。
ubuntu@node2:~$ ps aux | grep [a]vahi
root 26501 0.0 0.0 4204 356 ? S 19:21 0:00 supervise avahi
ubuntu 26527 0.0 0.0 4216 352 ? S 19:21 0:00 multilog s8388608 n10 /var/log/avahi
avahi 29418 0.0 0.0 32484 1632 ? S 20:12 0:00 avahi-daemon: running [node2.local]
avahi 29419 0.0 0.0 32224 464 ? S 20:12 0:00 avahi-daemon: chroot helper
root 29425 0.0 0.0 17192 1032 ? S 20:12 0:00 avahi-publish-service -as node2 _foobar._tcp 8080
diff --git a/avahi-core/server.c b/avahi-core/server.c
index 69a1d02..03d4fc1 100644
--- a/avahi-core/server.c
+++ b/avahi-core/server.c
@@ -1216,8 +1216,8 @@ static void register_browse_domain(AvahiServer *s) {
static void register_stuff(AvahiServer *s) {
assert(s);
- server_set_state(s, AVAHI_SERVER_REGISTERING);
s->n_host_rr_pending ++; /** Make sure that the state isn't changed tp AVAHI_SERVER_RUNNING too early */
+ server_set_state(s, AVAHI_SERVER_REGISTERING);
register_hinfo(s);
register_browse_domain(s);