我已经安装了 resolvconf,但是由于某种原因,resolvconf-pull-resolved 不想启动,知道是什么阻止了这种情况吗?我认为是 systemd,但我甚至不知道这个 pull 服务是干什么的
● resolvconf-pull-resolved.service
Loaded: loaded (/lib/systemd/system/resolvconf-pull-resolved.service; static; vendor preset: enabled)
Active: inactive (dead) since Mon 2018-09-24 13:11:46 UTC; 4s ago
Process: 10656 ExecStart=/bin/sh -c cat /run/systemd/resolve/stub-resolv.conf | /sbin/resolvconf -a systemd-resolved (code=exited, status=0/SUCCESS)
Main PID: 10656 (code=exited, status=0/SUCCESS)
Sep 24 13:11:46 Inspire systemd[1]: Starting resolvconf-pull-resolved.service...
Sep 24 13:11:46 Inspire systemd[1]: Started resolvconf-pull-resolved.service.
和 journalctl
journalctl | grep resolvconf
Sep 24 12:58:39 Inspire sudo[9844]: root : TTY=pts/0 ; PWD=/etc ; USER=root ; COMMAND=/usr/local/bin/apt install resolvconf
Sep 24 12:58:46 Inspire systemd[1]: Started resolvconf-pull-resolved.path.
Sep 24 12:58:53 Inspire systemd[1]: Starting resolvconf-pull-resolved.service..
答案1
我认为该服务运行良好,只是预计不会继续运行。它运行以下命令:
/bin/sh -c cat /run/systemd/resolve/stub-resolv.conf | /sbin/resolvconf -a systemd-resolved
阅读手册页resolvconf
显示:
resolvconf 软件包包含一个用于存储运行时名称服务器信息的简单数据库和一个用于通知应用程序该信息变化的简单框架。因此,Resolvconf 将自身设置为提供名称服务器信息的程序与使用该信息的应用程序之间的中介。
使用 resolvconf 程序向数据库添加或删除信息。有关可用选项的讨论,请参阅下面的 OPTIONS 部分。
选项如下-a
:
-a IFACE.PROG
添加或覆盖记录 IFACE.PROG,然后运行更新脚本(如果启用了更新)。使用此选项时,必须以 resolv.conf(5) 文件的格式在标准输入中向 resolvconf 提供信息。文件中的每一行都必须以换行符结尾。
看起来它创建了 resolvconf 数据库然后退出。
答案2
为了解决这个问题,您需要遵循以下步骤。
systemctl start resolvconf.service
systemctl enable resolvconf.service
systemctl start resolvconf-pull-resolved.service
systemctl enable resolvconf-pull-resolved.service
systemctl start resolvconf
systemctl enable resolvconf
dpkg-reconfigure resolvconf
享受!