Centos 7.0
chronyc (chrony) версия 3.1 (+ READLINE + IPV6 + DEBUG)
Я хочу найти способ заставить chronyd изменить аппаратные часы мгновенно без ожидания.
Программа chronyd
в настоящее время работает на моем компьютере:
[root@localhost ~]# ps -ef | grep chronyd
chrony 599 1 0 21:59 ? 00:00:00 /usr/sbin/chronyd
root 6710 4779 0 22:31 pts/0 00:00:00 grep --color=auto chron
chronyd
фактически настроен таким образом в файле /etc/chrony.conf
:
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift
# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3
# Enable kernel synchronization of the real-time clock (RTC).
rtcsync
# Enable hardware timestamping on all interfaces that support it.
hwtimestamp *
# Increase the minimum number of selectable sources required to adjust
# the system clock.
#minsources 2
# Allow NTP client access from local network.
allow 192.168.0.0/16
# Ignore stratum in source selection.
stratumweight 0
# Specify directory for log files.
logdir /var/log/chrony
# Select which information is logged.
#log measurements statistics tracking
pool chronos.univ-brest.fr
Хост NTP, который запрашивает машина, это chronos.univ-brest.fr
, и машина может проверить связь с ним:
[root@localhost ~]# ping chronos.univ-brest.fr
PING chronos.univ-brest.fr (195.83.247.18) 56(84) bytes of data.
64 bytes from chronos.univ-brest.fr (195.83.247.18): icmp_seq=1 ttl=239 time=38.3 ms
64 bytes from chronos.univ-brest.fr (195.83.247.18): icmp_seq=2 ttl=239 time=38.7 ms
Единственное подобное сообщение, которое я обнаружил, не решает моя проблема https://stackoverflow.com/questions/49730407/how-to-resynchronize-with-chrony
Текущая дата на машине следующая:
[root@localhost ~]# date
jeu. févr. 2 22:40:21 CET 1978
Я хотел бы найти способ принудительно chronyd
для изменения аппаратных часов
мгновенно к дате, указанной хостом NTP.
Если chronyd еще не запущен, команда, похожая на 'ntpdate pool.ntp.org 'может быть (начиная с версии 1.30):
chronyd -q 'server pool.ntp.org iburst'
Если он уже запущен и для него настроено несколько серверов, эквивалент:
chronyc -a 'burst 4/4'
Если вы хотите, чтобы chronyd также перешагивал по часам вместо поворота, если - это большее смещение, а chrony.conf не включает неограниченное количество шагов директиве, вам также необходимо подождать, пока новые измерения не будут сделано, а затем скажите хрониду сделать шаг:
sleep 10
chronyc -a makestep