$ sudo journalctl -fu chrony
-- Logs begin at Thu 2019-11-14 03:51:16 UTC. --
Nov 22 01:46:40 miranda-ntp-server-01 chronyd[5984]: Selected source 169.254.169.123
Nov 22 02:29:29 miranda-ntp-server-01 systemd[1]: Stopping chrony, an NTP client/server...
Nov 22 02:29:29 miranda-ntp-server-01 systemd[1]: Stopped chrony, an NTP client/server.
Nov 22 02:29:29 miranda-ntp-server-01 systemd[1]: Starting chrony, an NTP client/server...
Nov 22 02:29:29 miranda-ntp-server-01 chronyd[9999]: chronyd version 3.0 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SECHASH +SIGND +ASYNCDNS +IPV6 -DEBUG)
Nov 22 02:29:29 miranda-ntp-server-01 chronyd[9999]: Could not open IPv6 NTP socket : Address family not supported by protocol
Nov 22 02:29:29 miranda-ntp-server-01 systemd[1]: Started chrony, an NTP client/server.
Nov 22 02:29:29 miranda-ntp-server-01 chronyd[9999]: Frequency 29.566 +/- 0.024 ppm read from /var/lib/chrony/drift
Nov 22 02:29:29 miranda-ntp-server-01 chronyd[9999]: Using right/UTC timezone to obtain leap second data
Nov 22 02:29:34 miranda-ntp-server-01 chronyd[9999]: Selected source 169.254.169.123
$ sudo cat /lib/systemd/system/chrony.service
[Unit]
Description=chrony, an NTP client/server
Documentation=man:chronyd(8) man:chronyc(1) man:chrony.conf(5)
Conflicts=systemd-timesyncd.service openntpd.service
After=network.target
ConditionCapability=CAP_SYS_TIME
[Service]
Type=forking
PIDFile=/run/chronyd.pid
ExecStart=/usr/sbin/chronyd -4
PrivateTmp=yes
ProtectHome=yes
ProtectSystem=full
[Install]
Alias=chronyd.service
WantedBy=multi-user.target
为了澄清起见,我想禁用 chrony 使用 ipv6。
答案1
显然,您告诉它仅使用 IPv4 运行,而不是 IPv6:
ExecStart=/usr/sbin/chronyd -4
记录在chronyd(8) 手册页:
选项
-4 使用此选项,主机名将仅解析为 IPv4 地址,并且仅会创建 IPv4 套接字。
-6 使用此选项,主机名将仅解析为 IPv6 地址,并且仅会创建 IPv6 套接字。