$ systemctl status avahi-daemon
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2018-05-08 08:01:52 BST; 8h ago
Main PID: 817 (avahi-daemon)
Status: "avahi-daemon 0.7 starting up."
Tasks: 2 (limit: 4915)
Memory: 1.8M
CGroup: /system.slice/avahi-daemon.service
├─817 avahi-daemon: running [alan-laptop.local]
└─852 avahi-daemon: chroot helper
$ rpm -q avahi
avahi-0.7-12.fc28.x86_64
答案1
avahi-daemon 源代码的源代码包含更多状态消息,例如
sd_notifyf(0, "STATUS=服务器启动完成。主机名为 %s。本地服务 cookie 为 %u。", avahi_server_get_host_name_fqdn(s), avahi_server_get_local_service_cookie(s));
但是,默认情况下,avahi-daemon 在启动期间进入安全 chroot。这意味着它无法访问 systemd 通知套接字/run/systemd/notify
。它已阻止自身向 systemd 发送状态消息。哎呀。
# ls -l /proc/817/root
lrwxrwxrwx. 1 root root 0 May 8 16:27 /proc/817/root -> /etc/avahi
# ls -l /proc/817/root/
-rw-r--r--. 1 root root 1753 Jul 10 2017 avahi-daemon.conf
drwxr-xr-x. 2 root root 4096 Apr 6 16:48 etc
-rw-r--r--. 1 root root 1121 Jul 10 2017 hosts
drwxr-xr-x. 2 root root 4096 Apr 6 16:48 services