강제 시간 확인

강제 시간 확인

문맥:

  • 센토스 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 호스트가 지정한 날짜로 즉시 강제로 변경하는 방법을 찾고 싶습니다 .

답변1

chronyd가 아직 실행되고 있지 않은 경우 'ntpdate pool.ntp.org'와 유사한 명령을 사용할 수 있습니다(버전 1.30부터).

chronyd -q 'server pool.ntp.org iburst'

이미 실행 중이고 일부 서버가 구성되어 있는 경우 이에 상응하는 내용은 다음과 같습니다.

chronyc -a 'burst 4/4'

더 큰 오프셋이 있고 chrony.conf에 무제한 makestep 지시문이 포함되어 있지 않은 경우 chronyd가 회전 대신 시계를 단계적으로 진행하도록 하려면 새 측정이 이루어질 때까지 기다린 다음 chronyd에게 다음을 수행하도록 지시해야 합니다. 단계:

sleep 10
chronyc -a makestep

관련 정보