avahi-daemon Linux 服务在客户端机器上运行以执行基于网络的 Zeroconf 服务发现。
Avahi 是 Zeroconf 网络的 DNS 服务发现和多播 DNS 规范的实现。
用户应用程序使用 Linux D-Bus 消息传递接收发现的网络服务和资源的通知。
守护进程协调应用程序在缓存回复方面的工作,帮助最大限度地减少网络流量。
Avahi 提供了一组语言绑定,包括 Python 和 Mono。
由于其模块化架构,Avahi 已经集成到主要桌面组件中,例如 GNOME 的虚拟文件系统或者 KDE 的输入/输出架构。
有关更多规范,请参阅 http://avahi.org/。
avahi RPM 包提供了 /usr/sbin/avahi-daemon 守护进程及其配置文件。
欢迎来到之路教程(on itroad-com)
配置avahi
下面是示例配置文件 /etc/avahi/avahi-daemon.conf:
# cat /etc/avahi/avahi-daemon.conf # $Id: avahi-daemon.conf 1155 2006-02-22 22:54:56Z lennart $ # # This file is part of avahi. # # avahi is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # avahi is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public # License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with avahi; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA. # See avahi-daemon.conf(5) for more information on this configuration # file! [server] #host-name=foo #domain-name=local browse-domains=0pointer.de, zeroconf.org use-ipv4=yes use-ipv6=yes #check-response-ttl=no #use-iff-running=no #enable-dbus=yes #disallow-other-stacks=no #allow-point-to-point=no [wide-area] enable-wide-area=yes [publish] #disable-publishing=no #disable-user-service-publishing=no #add-service-cookie=yes #publish-addresses=yes #publish-hinfo=yes #publish-workstation=yes #publish-domain=yes #publish-dns-servers=192.168.50.1, 192.168.50.2 #publish-resolv-conf-dns-servers=yes [reflector] #enable-reflector=no #reflect-ipv=no [rlimits] #rlimit-as= rlimit-core=0 rlimit-data=4194304 rlimit-fsize=0 rlimit-nofile=30 rlimit-stack=4194304 rlimit-nproc=3
服务控制
要按需管理 avahi-daemon 服务,请使用 service(8) 工具或者直接运行 /etc/init.d/avahi-daemon 脚本:
# service avahi-daemon Usage: /etc/init.d/avahi-daemon {start|stop|status|restart|condrestart}
# /etc/init.d/avahi-daemon Usage: /etc/init.d/avahi-daemon {start|stop|status|restart|condrestart}
可用的命令有:
命令 | 说明 |
---|---|
start | 启动 avahi-daemon 守护进程。 |
stop | 停止 avahi-daemon 守护进程。 |
status | 报告 avahi-daemon 守护进程是否正在运行。 |
restart | 相当于先停止然后再启动命令序列。 |
condrestart | 如果 avahi-daemon 守护程序当前正在运行,则这与重新启动命令相同。 如果守护程序未运行,则不执行任何操作。 通常用于 RPM 包安装以避免启动尚未运行的服务。 |
要在启动时管理 avahi-daemon 服务,请使用 chkconfig 命令:
# chkconfig --list avahi-daemon avahi-daemon 0:off 1:off 2:off 3:off 4:off 5:off 6:off
# chkconfig avahi-daemon on
# chkconfig --list avahi-daemon avahi-daemon 0:off 1:off 2:on 3:on 4:on 5:on 6:off
日期:2020-09-17 00:14:34 来源:oir作者:oir