LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 04-04-2022, 10:51 AM   #16
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,759

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931

I thought that chronyd started similarly to ntp and would force a time update. Try:

systemctl stop chronyd

chronyd -q 'pool es.pool.ntp.org iburst'
 
Old 04-04-2022, 10:59 AM   #17
SPiKeGoD
LQ Newbie
 
Registered: Apr 2022
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by michaelk View Post
I thought that chronyd started similarly to ntp and would force a time update. Try:

systemctl stop chronyd

chronyd -q 'pool es.pool.ntp.org iburst'
Code:
[root@localhost ~]# systemctl stop chronyd
[root@localhost ~]# chronyd -q 'pool es.pool.ntp.org iburst'
2022-04-04T22:54:04Z chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
2022-04-04T22:54:04Z Initial frequency -50.037 ppm
2022-04-04T22:54:09Z System clock wrong by -24929.716105 seconds (step)
2022-04-04T15:58:39Z chronyd exiting
The time is the same

Code:
[root@localhost ~]# date
Tue Apr  5 00:54:13 CEST 2022
Code:
[root@localhost ~]# timedatectl
      Local time: Tue 2022-04-05 00:54:17 CEST
  Universal time: Mon 2022-04-04 22:54:17 UTC
        RTC time: Mon 2022-04-04 15:58:49
       Time zone: Europe/Madrid (CEST, +0200)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2022-03-27 01:59:59 CET
                  Sun 2022-03-27 03:00:00 CEST
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2022-10-30 02:59:59 CEST
                  Sun 2022-10-30 02:00:00 CET
 
Old 04-04-2022, 11:25 AM   #18
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,759

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
I am confused.
Code:
2022-04-04T22:54:09Z System clock wrong by -24929.716105 seconds (step)
2022-04-04T15:58:39Z chronyd exiting
This looks like the time was updated from 22:54:09Z to 15:58:39Z which was the UTC at the time of posting.
Yet the output of the timedatectl did not change.
 
Old 04-04-2022, 11:31 AM   #19
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,759

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
With chronyd stopped can you manually set time using the date command?
 
Old 04-04-2022, 11:37 AM   #20
SPiKeGoD
LQ Newbie
 
Registered: Apr 2022
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by michaelk View Post
With chronyd stopped can you manually set time using the date command?
The command doesn't do anything

Code:
[root@localhost ~]# systemctl stop chronyd
[root@localhost ~]# date -s "2022-04-04 18:37:30"
Mon Apr  4 18:37:30 CEST 2022
[root@localhost ~]# date
Tue Apr  5 01:32:49 CEST 2022
Code:
[root@localhost ~]# timedatectl
      Local time: Tue 2022-04-05 01:33:45 CEST
  Universal time: Mon 2022-04-04 23:33:45 UTC
        RTC time: Mon 2022-04-04 16:38:17
       Time zone: Europe/Madrid (CEST, +0200)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2022-03-27 01:59:59 CET
                  Sun 2022-03-27 03:00:00 CEST
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2022-10-30 02:59:59 CEST
                  Sun 2022-10-30 02:00:00 CET
 
Old 04-04-2022, 02:39 PM   #21
SPiKeGoD
LQ Newbie
 
Registered: Apr 2022
Posts: 15

Original Poster
Rep: Reputation: 0
@michaelk do you know any more things that i can check? Thanks you very much
 
Old 04-04-2022, 03:41 PM   #22
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,759

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
ntpdate should be install by default try:

ntpdate es.pool.ntp.org
 
Old 04-05-2022, 01:16 AM   #23
SPiKeGoD
LQ Newbie
 
Registered: Apr 2022
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by michaelk View Post
ntpdate should be install by default try:

ntpdate es.pool.ntp.org
The command is working, but now also there are difference with de minutes not only in hours

Code:
[root@localhost ~]# ntpdate es.pool.ntp.org
 5 Apr 08:14:49 ntpdate[24116]: step time server 185.179.104.12 offset -24929.708733 sec
Code:
[root@localhost ~]# date
Tue Apr  5 15:10:21 CEST 2022
Code:
[root@localhost ~]# timedatectl
      Local time: Tue 2022-04-05 15:10:30 CEST
  Universal time: Tue 2022-04-05 13:10:30 UTC
        RTC time: Tue 2022-04-05 06:14:59
       Time zone: Europe/Madrid (CEST, +0200)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2022-03-27 01:59:59 CET
                  Sun 2022-03-27 03:00:00 CEST
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2022-10-30 02:59:59 CEST
                  Sun 2022-10-30 02:00:00 CET
 
Old 04-05-2022, 10:09 AM   #24
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,759

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
Is this a physical or virtual machine?

Have you tried syncing the system clock to the hardware clock?

hwclock --hctosys
 
1 members found this post helpful.
Old 04-05-2022, 10:16 AM   #25
SPiKeGoD
LQ Newbie
 
Registered: Apr 2022
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by michaelk View Post
Is this a physical or virtual machine?

Have you tried syncing the system clock to the hardware clock?

hwclock --hctosys
I have tried a lot of things, and rebooted the machine and now it seems that it is OK:

Code:
[root@localhost ~]# date
Tue Apr  5 17:13:20 CEST 2022
Code:
[root@localhost ~]# timedatectl
      Local time: Tue 2022-04-05 17:13:25 CEST
  Universal time: Tue 2022-04-05 15:13:25 UTC
        RTC time: Tue 2022-04-05 15:13:25
       Time zone: Europe/Madrid (CEST, +0200)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2022-03-27 01:59:59 CET
                  Sun 2022-03-27 03:00:00 CEST
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2022-10-30 02:59:59 CEST
                  Sun 2022-10-30 02:00:00 CET
Code:
[root@localhost ~]# systemctl status chronyd
● chronyd.service - NTP client/server
   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2022-04-05 13:27:27 CEST; 3h 46min ago
     Docs: man:chronyd(8)
           man:chrony.conf(5)
  Process: 780 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS)
  Process: 740 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 754 (chronyd)
   CGroup: /system.slice/chronyd.service
           └─754 /usr/sbin/chronyd

Apr 05 13:27:27 localhost.localdomain chronyd[754]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
Apr 05 13:27:27 localhost.localdomain chronyd[754]: Frequency -50.276 +/- 0.407 ppm read from /var/lib/chrony/drift
Apr 05 13:27:38 localhost.localdomain chronyd[754]: Selected source 178.32.88.247
Apr 05 13:28:44 localhost.localdomain chronyd[754]: Selected source 178.62.18.76
Better i don't go to use the "hwclock --hctosys", i was suffering a lot to fix it hehe

Thanks you very much for helping me
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot fix broken package using "sudo apt --fix-broken install" to fix XFCE packages for Zorin OS 16 Core AltFantasy Zorin OS 8 09-25-2021 06:51 AM
Python: datetime.datetime.strptime() trouble PoleStar Programming 4 12-15-2015 06:43 PM
How can I find files in Linux where filename contains datetime format pthakur Linux - Newbie 1 11-05-2015 04:43 AM
html form current datetime meluser Programming 27 04-16-2003 06:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 02:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration