
Contexto:
Centos 7.0
chronyc (chrony) versión 3.1 (+READLINE +IPV6 +DEBUG)
Asunto
Yo quieroencuentre una manera de obligar a chronyd a cambiar el reloj del hardware al instanteSin esperar.
El programa chronyd
se está ejecutando actualmente en mi 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
En realidad está configurado de esta manera en el archivo /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
El host NTP que la máquina está solicitando actualmente es chronos.univ-brest.fr
y la máquina puede hacer ping:
[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
La única publicación similar que encontré no resuelve mi problema.https://stackoverflow.com/questions/49730407/how-to-resincronizar-con-chrony
La fecha actual en la máquina es la siguiente:
[root@localhost ~]# date
jeu. févr. 2 22:40:21 CET 1978
Me gustaría encontrar una manera de forzar chronyd
el cambio instantáneo del reloj del hardware a la fecha proporcionada por el host NTP.
Respuesta1
Si chronyd aún no se está ejecutando, un comando similar a 'ntpdate pool.ntp.org' podría ser (desde la versión 1.30):
chronyd -q 'server pool.ntp.org iburst'
Si ya está funcionando y tiene algunos servidores configurados, un equivalente sería:
chronyc -a 'burst 4/4'
Si desea que chronyd también acelere el reloj en lugar de girar si hay un desplazamiento mayor y chrony.conf no incluye una directiva makestep ilimitada, también deberá esperar hasta que se realicen las nuevas mediciones y luego decirle a chronyd que realice la paso:
sleep 10
chronyc -a makestep