runsisi's

technical notes

禁用 avahi-daemon

2019-01-24 runsisi#linux

在机器上莫名出现 5353 的监听端口,根据分析是 avahi-daemon 服务,由于该服务没有任何意义,可以直接禁用:

~# systemctl mask avahi-daemon.socket avahi-daemon.service
Created symlink from /etc/systemd/system/avahi-daemon.socket to /dev/null.
Created symlink from /etc/systemd/system/avahi-daemon.service to /dev/null.
~# systemctl disable avahi-daemon.socket avahi-daemon.service
Removed symlink /etc/systemd/system/dbus-org.freedesktop.Avahi.service.
Removed symlink /etc/systemd/system/multi-user.target.wants/avahi-daemon.service.
Removed symlink /etc/systemd/system/sockets.target.wants/avahi-daemon.socket.
~# systemctl stop avahi-daemon.socket
~# systemctl stop avahi-daemon.service

参考资料

What is the purpose of avahi on a RHEL 7 server?

https://unix.stackexchange.com/questions/163124/what-is-the-purpose-of-avahi-on-a-rhel-7-server

Linux Avahi Daemon Tutorial With Examples

https://www.poftut.com/linux-avahi-daemon-tutorial-examples/

systemd.socket — Socket unit configuration

https://www.freedesktop.org/software/systemd/man/systemd.socket.html