
Contexto:
Centos 7.0
chronyc (chrony) versão 3.1 (+READLINE +IPV6 +DEBUG)
Emitir
Eu queroencontre uma maneira de forçar o chronyd a alterar o relógio do hardware instantaneamentesem esperar.
O programa chronyd
está atualmente em execução na minha máquina:
[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
na verdade está configurado desta forma no arquivo /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
O host NTP que a máquina está solicitando no momento é chronos.univ-brest.fr
e a máquina é capaz de fazer ping nele:
[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
A única postagem semelhante que encontrei não resolve meu problemahttps://stackoverflow.com/questions/49730407/how-to-resynchronize-with-chrony
A data atual na máquina é a seguinte:
[root@localhost ~]# date
jeu. févr. 2 22:40:21 CET 1978
Gostaria de encontrar uma maneira de forçar chronyd
a alteração instantânea do relógio do hardware para a data fornecida pelo host NTP.
Responder1
Se o chronyd ainda não estiver em execução, um comando semelhante a 'ntpdate pool.ntp.org' poderia ser (desde a versão 1.30):
chronyd -q 'server pool.ntp.org iburst'
Se já estiver rodando e tiver alguns servidores configurados, um equivalente seria:
chronyc -a 'burst 4/4'
Se você quiser que o chronyd também avance o relógio em vez de girar se houver um deslocamento maior e o chrony.conf não incluir uma diretiva makestep ilimitada, você também precisará esperar até que as novas medições sejam feitas e então dizer ao chronyd para fazer o etapa:
sleep 10
chronyc -a makestep