chronyd on debian could not open IPv6 NTP socket
$ 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
To clarify, I want to disable chrony from using ipv6.
Clearly, you are telling it to run only with IPv4, not IPv6:
ExecStart=/usr/sbin/chronyd -4
That is documented on chronyd(8) Manual Page:
OPTIONS
-4 With this option hostnames will be resolved only to IPv4 addresses and only IPv4 sockets will be created.
-6 With this option hostnames will be resolved only to IPv6 addresses and only IPv6 sockets will be created.