You are not logged in.

#1 2021-12-25 12:22:14

avasam
Member
Registered: 2020-01-26
Posts: 72
Website

[SOLVED] Disrupt local clock in every login - Archlinux + Xfce4

My system clock has been displayed incorrectly for several days. when i run timedatectl status output is something like this :

➜ timedatectl status

 Local time: Sat 2021-12-25 19:16:57 +0330
           Universal time: Sat 2021-12-25 15:46:57 UTC
                 RTC time: Sat 2021-12-25 15:46:57
                Time zone: Asia/Tehran (+0330, +0330)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no

Universal time and RTC time is correct but Local time is incorrect !

local time will fix after run sudo ntpd -qg .

But when i restart system Everything goes back and goes wrong ...

How can i solve this problem ?

i use arch+xfce4

Last edited by avasam (2022-07-25 18:17:11)

Offline

#2 2021-12-25 12:55:07

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] Disrupt local clock in every login - Archlinux + Xfce4

If that universal time is correct, you appear to be sending messages from the future. You probably mean that the time shown after Universal/RTC time is actually your local time. That should be simple to fix: as you said, running ntpd corrects the local time, but it should also change "Universal time:" but not "RTC time:". To write the corrected UTC time to the hardware clock (RTC), use https://wiki.archlinux.org/title/System … stem_clock

Offline

#3 2021-12-25 13:01:17

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,268

Re: [SOLVED] Disrupt local clock in every login - Archlinux + Xfce4

Adding 3:30 to Sat 2021-12-25 15:46:57 UTC does result in Sat 2021-12-25 19:16:57 , so the 3 times are consistent.

NTP service: active usually means you're running systemd-timesyncd[1] not ntp .

Is the timezone Asia/Theran correct for your location ?
Please post the output of

$ timedatectl timesync-status



[1] https://wiki.archlinux.org/title/Systemd-timesyncd


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#4 2021-12-25 13:46:20

avasam
Member
Registered: 2020-01-26
Posts: 72
Website

Re: [SOLVED] Disrupt local clock in every login - Archlinux + Xfce4

Lone_Wolf wrote:

Adding 3:30 to Sat 2021-12-25 15:46:57 UTC does result in Sat 2021-12-25 19:16:57 , so the 3 times are consistent.

NTP service: active usually means you're running systemd-timesyncd[1] not ntp .

Is the timezone Asia/Theran correct for your location ?
Please post the output of

$ timedatectl timesync-status



[1] https://wiki.archlinux.org/title/Systemd-timesyncd

this is output :

➜ timedatectl timesync-status
       Server: n/a (ur.ntp.srv)
Poll interval: 0 (min: 32s; max 34min 8s)
 Packet count: 0

And my location is Asia/Tehran

Last edited by avasam (2021-12-25 14:12:16)

Offline

#5 2021-12-25 13:52:54

avasam
Member
Registered: 2020-01-26
Posts: 72
Website

Re: [SOLVED] Disrupt local clock in every login - Archlinux + Xfce4

Raynman wrote:

If that universal time is correct, you appear to be sending messages from the future. You probably mean that the time shown after Universal/RTC time is actually your local time. That should be simple to fix: as you said, running ntpd corrects the local time, but it should also change "Universal time:" but not "RTC time:". To write the corrected UTC time to the hardware clock (RTC), use https://wiki.archlinux.org/title/System … stem_clock

yes i was wrong ! actually in first universal time = my local time and after run sudo ntpd -qg
it will fix like this :

➜ sudo ntpd -qg
[sudo] password for march: 
25 Dec 20:49:51 ntpd[1868]: ntpd 4.2.8p15@1.3728-o Wed Jul  1 17:02:17 UTC 2020 (1): Starting
25 Dec 20:49:51 ntpd[1868]: Command line: ntpd -qg
25 Dec 20:49:51 ntpd[1868]: ----------------------------------------------------
25 Dec 20:49:51 ntpd[1868]: ntp-4 is maintained by Network Time Foundation,
25 Dec 20:49:51 ntpd[1868]: Inc. (NTF), a non-profit 501(c)(3) public-benefit
25 Dec 20:49:51 ntpd[1868]: corporation.  Support and training for ntp-4 are
25 Dec 20:49:51 ntpd[1868]: available at https://www.nwtime.org/support
25 Dec 20:49:51 ntpd[1868]: ----------------------------------------------------
25 Dec 20:49:51 ntpd[1868]: proto: precision = 0.055 usec (-24)
25 Dec 20:49:51 ntpd[1868]: basedate set to 2020-06-19
25 Dec 20:49:51 ntpd[1868]: gps base set to 2020-06-21 (week 2111)
25 Dec 20:49:51 ntpd[1868]: Listen and drop on 0 v6wildcard [::]:123
25 Dec 20:49:51 ntpd[1868]: Listen and drop on 1 v4wildcard 0.0.0.0:123
25 Dec 20:49:51 ntpd[1868]: Listen normally on 2 lo 127.0.0.1:123
25 Dec 20:49:51 ntpd[1868]: Listen normally on 3 enp6s0 192.168.0.138:123
25 Dec 20:49:51 ntpd[1868]: Listen normally on 4 lo [::1]:123
25 Dec 20:49:51 ntpd[1868]: Listen normally on 5 enp6s0 [fe80::1d60:ca09:8ee0:72d%2]:123
25 Dec 20:49:51 ntpd[1868]: Listening on routing socket on fd #22 for interface updates
25 Dec 17:19:59 ntpd[1868]: ntpd: time set -12600.106000 s
ntpd: time set -12600.106000s

And the

➜ timedatectl status
               Local time: Sat 2021-12-25 17:20:06 +0330
           Universal time: Sat 2021-12-25 13:50:06 UTC
                 RTC time: Sat 2021-12-25 17:20:06
                Time zone: Asia/Tehran (+0330, +0330)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no

Offline

#6 2021-12-25 16:58:40

avasam
Member
Registered: 2020-01-26
Posts: 72
Website

Re: [SOLVED] Disrupt local clock in every login - Archlinux + Xfce4

No one to help me?

Offline

#7 2021-12-25 17:11:16

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: [SOLVED] Disrupt local clock in every login - Archlinux + Xfce4

avasam wrote:

No one to help me?

Don't do that. https://wiki.archlinux.org/title/Genera … es#Bumping

It's Christmas day -- maybe people have other things to do? Everyone here is a volunteer; you need to learn some patience.

Offline

#8 2021-12-25 17:28:13

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] Disrupt local clock in every login - Archlinux + Xfce4

avasam wrote:

No one to help me?

Did you read the link you were given in post 2? Do you understand the difference between UTC and localtime (also covered on that same page)? At this point, you shouldn't need any more help. everything has been covered.

Offline

#9 2021-12-25 17:30:21

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,493
Website

Re: [SOLVED] Disrupt local clock in every login - Archlinux + Xfce4

From your last post, the UTC time is correct (after the ntp adjustment).  But you can see it has not been set to the RTC yet as the UTC != RTC.  So follow the advice you have been given to complete the fix:

Raynman wrote:

That should be simple to fix: as you said, running ntpd corrects the local time, but it should also change "Universal time:" but not "RTC time:". To write the corrected UTC time to the hardware clock (RTC), use https://wiki.archlinux.org/title/System … stem_clock


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2021-12-25 19:38:56

avasam
Member
Registered: 2020-01-26
Posts: 72
Website

Re: [SOLVED] Disrupt local clock in every login - Archlinux + Xfce4

Trilby wrote:

From your last post, the UTC time is correct (after the ntp adjustment).  But you can see it has not been set to the RTC yet as the UTC != RTC.  So follow the advice you have been given to complete the fix:

Raynman wrote:

That should be simple to fix: as you said, running ntpd corrects the local time, but it should also change "Universal time:" but not "RTC time:". To write the corrected UTC time to the hardware clock (RTC), use https://wiki.archlinux.org/title/System … stem_clock

Forgive me for not being careful this link fixed my problem.
i just run this command in terminal to set the hardware clock from the system clock and Fixed :

# hwclock --systohc

and you have to make sure run this command before  :

timedatectl set-ntp true

Last edited by avasam (2024-03-05 08:36:11)

Offline

#11 2021-12-25 23:27:01

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: [SOLVED] Disrupt local clock in every login - Archlinux + Xfce4

Please remember to mark your thread [SOLVED] (edit the title of your first post).

Offline

Board footer

Powered by FluxBB