mylovesaber / Tools-Share

存放各种自动化工具
GNU General Public License v3.0
38 stars 9 forks source link

debian11刷新系统缓存似乎有问题 #7

Closed BA7JCM closed 1 year ago

BA7JCM commented 2 years ago

用从Debian官网下载的xfce的live cd安装的系统,运行的时候在刷新dns的时候报错

正在刷新 DNS 缓存...
Failed to flush caches: Unit dbus-org.freedesktop.resolve1.service not found.
DNS 缓存刷新完成

image

mylovesaber commented 2 years ago

查了下,原因很简单,我这个是给无桌面环境使用的,你有桌面,好像用的是network-manager来管理,工具本身是通过systemd-resolved来实现的刷新,二者相互冲突,你输入这个看看有没有什么信息: systemctl status NetworkManager

mylovesaber commented 2 years ago

我暂时没有条件测试,需要你自行测试下给个反馈

BA7JCM commented 2 years ago

查了下,原因很简单,我这个是给无桌面环境使用的,你有桌面,好像用的是network-manager来管理,工具本身是通过systemd-resolved来实现的刷新,二者相互冲突,你输入这个看看有没有什么信息: systemctl status NetworkManager

root@leafhomedns:~# systemctl status NetworkManager
● NetworkManager.service - Network Manager
     Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-05-28 01:04:30 CST; 1 weeks 4 days ago
       Docs: man:NetworkManager(8)
   Main PID: 430 (NetworkManager)
      Tasks: 3 (limit: 4516)
     Memory: 7.4M
        CPU: 4min 51.288s
     CGroup: /system.slice/NetworkManager.service
             └─430 /usr/sbin/NetworkManager --no-daemon

6月 06 12:22:49 leafhomedns NetworkManager[430]: <info>  [1654489369.5532] dhcp6 (enp1s0): state changed bound -> bound>
6月 06 18:08:33 leafhomedns NetworkManager[430]: <info>  [1654510113.5678] dhcp6 (enp1s0): state changed bound -> bound>
6月 06 23:47:33 leafhomedns NetworkManager[430]: <info>  [1654530453.5687] dhcp6 (enp1s0): state changed bound -> bound>
6月 07 03:17:47 leafhomedns NetworkManager[430]: <info>  [1654543067.8614] policy: set '以太网连接 1' (enp1s0) as defau>
6月 07 05:42:03 leafhomedns NetworkManager[430]: <info>  [1654551723.5673] dhcp6 (enp1s0): state changed bound -> bound>
6月 07 11:33:41 leafhomedns NetworkManager[430]: <info>  [1654572821.5422] dhcp6 (enp1s0): state changed bound -> bound>
6月 07 17:28:33 leafhomedns NetworkManager[430]: <info>  [1654594113.5670] dhcp6 (enp1s0): state changed bound -> bound>
6月 07 22:58:39 leafhomedns NetworkManager[430]: <info>  [1654613919.0473] dhcp6 (enp1s0): state changed bound -> bound>
6月 08 04:40:13 leafhomedns NetworkManager[430]: <info>  [1654634413.5672] dhcp6 (enp1s0): state changed bound -> bound>
6月 08 10:25:34 leafhomedns NetworkManager[430]: <info>  [1654655134.0617] dhcp6 (enp1s0): state changed bound -> bound>
lines 1-21/21 (END)
mylovesaber commented 2 years ago

Failed to flush caches: Unit dbus-org.freedesktop.resolve1.service not found

systemctl status systemd-resolved.service 看看有什么提醒

BA7JCM commented 2 years ago

Failed to flush caches: Unit dbus-org.freedesktop.resolve1.service not found

systemctl status systemd-resolved.service 看看有什么提醒

root@leafhomedns:~# systemctl status systemd-resolved.service
● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd-resolved.service(8)
             man:org.freedesktop.resolve1(5)
             https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
             https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
root@leafhomedns:~#
mylovesaber commented 2 years ago

Failed to flush caches: Unit dbus-org.freedesktop.resolve1.service not found

systemctl status systemd-resolved.service 看看有什么提醒

root@leafhomedns:~# systemctl status systemd-resolved.service
● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd-resolved.service(8)
             man:org.freedesktop.resolve1(5)
             https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
             https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
root@leafhomedns:~#

systemctl start systemd-resolved && systemctl enable systemd-resolved && systemd-resolve --flush-caches 看看有报错么?

BA7JCM commented 2 years ago

Failed to flush caches: Unit dbus-org.freedesktop.resolve1.service not found

systemctl status systemd-resolved.service 看看有什么提醒

root@leafhomedns:~# systemctl status systemd-resolved.service
● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd-resolved.service(8)
             man:org.freedesktop.resolve1(5)
             https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
             https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
root@leafhomedns:~#

systemctl start systemd-resolved && systemctl enable systemd-resolved && systemd-resolve --flush-caches 看看有报错么?

没报错,正常创建了软链接

root@leafhomedns:~# systemctl start systemd-resolved && systemctl enable systemd-resolved && systemd-resolve --flush-caches
Created symlink /etc/systemd/system/dbus-org.freedesktop.resolve1.service → /lib/systemd/system/systemd-resolved.service.
Created symlink /etc/systemd/system/multi-user.target.wants/systemd-resolved.service → /lib/systemd/system/systemd-resolved.service.
root@leafhomedns:~#
mylovesaber commented 2 years ago

Failed to flush caches: Unit dbus-org.freedesktop.resolve1.service not found

systemctl status systemd-resolved.service 看看有什么提醒

root@leafhomedns:~# systemctl status systemd-resolved.service
● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd-resolved.service(8)
             man:org.freedesktop.resolve1(5)
             https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
             https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
root@leafhomedns:~#

systemctl start systemd-resolved && systemctl enable systemd-resolved && systemd-resolve --flush-caches 看看有报错么?

没报错,正常创建了软链接

root@leafhomedns:~# systemctl start systemd-resolved && systemctl enable systemd-resolved && systemd-resolve --flush-caches
Created symlink /etc/systemd/system/dbus-org.freedesktop.resolve1.service → /lib/systemd/system/systemd-resolved.service.
Created symlink /etc/systemd/system/multi-user.target.wants/systemd-resolved.service → /lib/systemd/system/systemd-resolved.service.
root@leafhomedns:~#

ok,我晚点加入适配

BA7JCM commented 2 years ago

Failed to flush caches: Unit dbus-org.freedesktop.resolve1.service not found

systemctl status systemd-resolved.service 看看有什么提醒

root@leafhomedns:~# systemctl status systemd-resolved.service
● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd-resolved.service(8)
             man:org.freedesktop.resolve1(5)
             https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
             https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
root@leafhomedns:~#

systemctl start systemd-resolved && systemctl enable systemd-resolved && systemd-resolve --flush-caches 看看有报错么?

没报错,正常创建了软链接

root@leafhomedns:~# systemctl start systemd-resolved && systemctl enable systemd-resolved && systemd-resolve --flush-caches
Created symlink /etc/systemd/system/dbus-org.freedesktop.resolve1.service → /lib/systemd/system/systemd-resolved.service.
Created symlink /etc/systemd/system/multi-user.target.wants/systemd-resolved.service → /lib/systemd/system/systemd-resolved.service.
root@leafhomedns:~#

ok,我晚点加入适配

可以改成systemctl enable systemd-resolved --now && systemd-resolve --flush-caches,有同样的效果,也没有报错

root@leafhomedns:~# systemctl stop systemd-resolved && systemctl disable systemd-resolved
Removed /etc/systemd/system/dbus-org.freedesktop.resolve1.service.
Removed /etc/systemd/system/multi-user.target.wants/systemd-resolved.service.
root@leafhomedns:~# systemctl enable systemd-resolved --now && systemd-resolve --flush-caches
Created symlink /etc/systemd/system/dbus-org.freedesktop.resolve1.service → /lib/systemd/system/systemd-resolved.service.
Created symlink /etc/systemd/system/multi-user.target.wants/systemd-resolved.service → /lib/systemd/system/systemd-resolved.service.
root@leafhomedns:~#
mylovesaber commented 2 years ago

嗯,是的,晚点调整,你现在启用了,后续这工具就都正常了

BA7JCM commented 2 years ago

嗯,是的,晚点调整,你现在启用了,后续这工具就都正常了

腾讯云Debian11镜像也有这个问题 image 看起来应该不是有无桌面的问题,因为服务器镜像一般都是无桌面的

mylovesaber commented 2 years ago

嗯,是的,晚点调整,你现在启用了,后续这工具就都正常了

腾讯云Debian11镜像也有这个问题 image 看起来应该不是有无桌面的问题,因为服务器镜像一般都是无桌面的

应该只是有无服务的问题,我近期还挺忙暂时没更新,这脚本结构有点老了,以后可能会更新下,你先按照以上教程操作下,这就是一个服务冲突吧 systemctl enable systemd-resolved --now && systemd-resolve --flush-caches 就是激活服务且加入开机自启,之后再用这个脚本应该就正常了

mylovesaber commented 2 years ago

嗯,是的,晚点调整,你现在启用了,后续这工具就都正常了

腾讯云Debian11镜像也有这个问题 image 看起来应该不是有无桌面的问题,因为服务器镜像一般都是无桌面的

这脚本目前有个比较奇葩的毛病,就是定时语法写的都对,但是有时候一分钟运行一次有时候不是,就很玄学。。23333

BA7JCM commented 2 years ago

嗯,是的,晚点调整,你现在启用了,后续这工具就都正常了

腾讯云Debian11镜像也有这个问题 image 看起来应该不是有无桌面的问题,因为服务器镜像一般都是无桌面的

这脚本目前有个比较奇葩的毛病,就是定时语法写的都对,但是有时候一分钟运行一次有时候不是,就很玄学。。23333

最近不知道是不是墙又加高了,以前git clone的时候就算不用这个脚本来优选IP,在仓库地址前面加上https://ghproxy.com/都能正常clone下来并且快不少,昨天试了下加不加这个前缀都一样,然后就想到了你这个脚本,结果发现用了也没能缓解多少

BA7JCM commented 2 years ago

嗯,是的,晚点调整,你现在启用了,后续这工具就都正常了

腾讯云Debian11镜像也有这个问题 image 看起来应该不是有无桌面的问题,因为服务器镜像一般都是无桌面的

这脚本目前有个比较奇葩的毛病,就是定时语法写的都对,但是有时候一分钟运行一次有时候不是,就很玄学。。23333

以前国内服务器用git clone https://ghproxy.com/github.com/xxx/yyy就能比直接git clone https://github.com/xxx/yyy快不少,昨晚用的时候加了ghproxy前缀大概几十KB/s,不加的话是几KB/s到几百b/s……

mylovesaber commented 2 years ago

嗯,是的,晚点调整,你现在启用了,后续这工具就都正常了

腾讯云Debian11镜像也有这个问题 image 看起来应该不是有无桌面的问题,因为服务器镜像一般都是无桌面的

这脚本目前有个比较奇葩的毛病,就是定时语法写的都对,但是有时候一分钟运行一次有时候不是,就很玄学。。23333

以前国内服务器用git clone https://ghproxy.com/github.com/xxx/yyy就能比直接git clone https://github.com/xxx/yyy快不少,昨晚用的时候加了ghproxy前缀大概几十KB/s,不加的话是几KB/s到几百b/s……

你可以试试转到gitlab下,用gitlab可以导入github的项目,然后GFW对gitlab没有任何限制~~谁让github名气比gitlab大太多了呢。。。

mylovesaber commented 2 years ago

嗯,是的,晚点调整,你现在启用了,后续这工具就都正常了

腾讯云Debian11镜像也有这个问题 image 看起来应该不是有无桌面的问题,因为服务器镜像一般都是无桌面的

这脚本目前有个比较奇葩的毛病,就是定时语法写的都对,但是有时候一分钟运行一次有时候不是,就很玄学。。23333

以前国内服务器用git clone https://ghproxy.com/github.com/xxx/yyy就能比直接git clone https://github.com/xxx/yyy快不少,昨晚用的时候加了ghproxy前缀大概几十KB/s,不加的话是几KB/s到几百b/s……

我现在写其他的项目都是直接同步到gitlab,非常香,再也不用担心被墙push不上去了,然后gitlab有一个镜像同步到github的功能,这项目也已经转移到gitlab上了,github只是分身,给github强迫症用

BA7JCM commented 2 years ago

嗯,是的,晚点调整,你现在启用了,后续这工具就都正常了

腾讯云Debian11镜像也有这个问题 image 看起来应该不是有无桌面的问题,因为服务器镜像一般都是无桌面的

这脚本目前有个比较奇葩的毛病,就是定时语法写的都对,但是有时候一分钟运行一次有时候不是,就很玄学。。23333

以前国内服务器用git clone https://ghproxy.com/github.com/xxx/yyy就能比直接git clone https://github.com/xxx/yyy快不少,昨晚用的时候加了ghproxy前缀大概几十KB/s,不加的话是几KB/s到几百b/s……

我现在写其他的项目都是直接同步到gitlab,非常香,再也不用担心被墙push不上去了,然后gitlab有一个镜像同步到github的功能,这项目也已经转移到gitlab上了,github只是分身,给github强迫症用

不知道gitlab对免费用户咋样,有没有啥限制

mylovesaber commented 2 years ago

嗯,是的,晚点调整,你现在启用了,后续这工具就都正常了

腾讯云Debian11镜像也有这个问题 image 看起来应该不是有无桌面的问题,因为服务器镜像一般都是无桌面的

这脚本目前有个比较奇葩的毛病,就是定时语法写的都对,但是有时候一分钟运行一次有时候不是,就很玄学。。23333

以前国内服务器用git clone https://ghproxy.com/github.com/xxx/yyy就能比直接git clone https://github.com/xxx/yyy快不少,昨晚用的时候加了ghproxy前缀大概几十KB/s,不加的话是几KB/s到几百b/s……

我现在写其他的项目都是直接同步到gitlab,非常香,再也不用担心被墙push不上去了,然后gitlab有一个镜像同步到github的功能,这项目也已经转移到gitlab上了,github只是分身,给github强迫症用

不知道gitlab对免费用户咋样,有没有啥限制

之前简单看过,和github基本没有区别,而且gitlab可以做成私有平台,一个公司一个平台的那种,所以比github开放太多了,唯一缺点就是写进脚本下载东西之类的需要专用的api来操作,这点没有github方便,不过你就clone的话没有区别

mylovesaber commented 1 year ago

已转移并修复

https://gitlab.com/mylovesaber/tools-share/-/tree/main/auto-update-github-hosts

BA7JCM commented 1 year ago

嗯,是的,晚点调整,你现在启用了,后续这工具就都正常了

腾讯云Debian11镜像也有这个问题 image 看起来应该不是有无桌面的问题,因为服务器镜像一般都是无桌面的

这脚本目前有个比较奇葩的毛病,就是定时语法写的都对,但是有时候一分钟运行一次有时候不是,就很玄学。。23333

以前国内服务器用git clone https://ghproxy.com/github.com/xxx/yyy就能比直接git clone https://github.com/xxx/yyy快不少,昨晚用的时候加了ghproxy前缀大概几十KB/s,不加的话是几KB/s到几百b/s……

我现在写其他的项目都是直接同步到gitlab,非常香,再也不用担心被墙push不上去了,然后gitlab有一个镜像同步到github的功能,这项目也已经转移到gitlab上了,github只是分身,给github强迫症用

不知道gitlab对免费用户咋样,有没有啥限制

之前简单看过,和github基本没有区别,而且gitlab可以做成私有平台,一个公司一个平台的那种,所以比github开放太多了,唯一缺点就是写进脚本下载东西之类的需要专用的api来操作,这点没有github方便,不过你就clone的话没有区别

gitlab好像也有raw链接吧,比如这个,就是你这个github仓库的gitlab版的readme的raw链接

https://gitlab.com/mylovesaber/tools-share/-/raw/main/auto-update-github-hosts/README.md
BA7JCM commented 1 year ago

已转移并修复

https://gitlab.com/mylovesaber/tools-share/-/tree/main/auto-update-github-hosts

感谢作者适配,回头我试试

mylovesaber commented 1 year ago

已转移并修复 https://gitlab.com/mylovesaber/tools-share/-/tree/main/auto-update-github-hosts

感谢作者适配,回头我试试

嗯,主要是近期开了好几个工具仓库,给合并成一个工具集了,这样看着也整洁点