wrong time and date after reboot

This forum is for topics dealing with problems with software specifically in the ARMv7h repo.

wrong time and date after reboot

Postby claus » Tue Oct 26, 2021 1:13 pm

Hello, after reboot I get always the wrong time and date and it needs 4-5 min until I see the right time. The time synchronization is a systemctl ntpd process. $this->bbcode_second_pass_code('', 'sudo systemctl status ntpd
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2021-10-20 22:04:51 CEST; 5 days ago
Process: 374 ExecStart=/usr/bin/ntpd -g -u ntp:ntp (code=exited, status=0/SUCCESS)
Main PID: 384 (ntpd)
Tasks: 2 (limit: 4915)
CPU: 167ms
CGroup: /system.slice/ntpd.service
└─384 /usr/bin/ntpd -g -u ntp:ntp

Okt 20 22:04:51 archlinux-raspi systemd[1]: Started Network Time Service.
Okt 20 22:04:56 archlinux-raspi ntpd[384]: bind(23) AF_INET6 2003:d4:cf17:3a00:dea6:32ff:fe86:6a8f#123 flags 0x11 failed: Cannot assign requested address
Okt 20 22:04:56 archlinux-raspi ntpd[384]: unable to create socket on wlan0 (4) for 2003:d4:cf17:3a00:dea6:32ff:fe86:6a8f#123
Okt 20 22:04:56 archlinux-raspi ntpd[384]: failed to init interface for address 2003:d4:cf17:3a00:dea6:32ff:fe86:6a8f
Okt 20 22:04:56 archlinux-raspi ntpd[384]: Listen normally on 5 wlan0 [fe80::dea6:32ff:fe86:6a8f%3]:123
Okt 20 22:04:56 archlinux-raspi ntpd[384]: new interface(s) found: waking up resolver
Okt 20 22:04:58 archlinux-raspi ntpd[384]: Listen normally on 6 wlan0 [2003:d4:cf17:3a00:dea6:32ff:fe86:6a8f]:123
Okt 20 22:04:58 archlinux-raspi ntpd[384]: new interface(s) found: waking up resolver
Okt 20 22:05:01 archlinux-raspi ntpd[384]: Listen normally on 7 wlan0 192.168.178.29:123
Okt 20 22:05:01 archlinux-raspi ntpd[384]: new interface(s) found: waking up resolver
')
Does anyone have an idea what the fault could be?
claus
 
Posts: 9
Joined: Thu Oct 21, 2021 7:26 am

Re: wrong time and date after reboot

Postby graysky » Tue Oct 26, 2021 5:58 pm

Not sure, have you tried systemd-timesyncd instead?
graysky
Developer
 
Posts: 1723
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: wrong time and date after reboot

Postby armuseru » Wed Oct 27, 2021 7:03 am

Many arm devices do not have hardware clocks, so it may not know real time before synchronization. Described lags at time synchronization is possible in case ntpd is not optimally configured or internet is slow
https://wiki.archlinux.org/title/Network_Time_Protocol_daemon :
$this->bbcode_second_pass_quote('', 't')ied to the system's resolver, and will start synchronizing when an active network connection is detected


There is a fake-hwclock package that records the system time before shutting down and restores it after boot. But I think it may help for server role devices only that periodically reboots and do not stay at poweroff for a long period of time
armuseru
 
Posts: 34
Joined: Sat Jan 09, 2021 9:36 am

Re: wrong time and date after reboot

Postby claus » Wed Oct 27, 2021 8:41 am

Thanks for your detailed answer. It could be that the WLAN is not the fasted and/or ntpd is not optimally configured. But what is the optimally configuration? I have some installation on other SD-Cards with buster or ubuntu server and there is no problem with time synchronization. What is the reason that the fake-hwclock records nonsense time -not the last time and date from the shutdown time? Any way I will study the attached wiki article about ntpd ( I did it in the past) again.
claus
 
Posts: 9
Joined: Thu Oct 21, 2021 7:26 am

Re: wrong time and date after reboot

Postby armuseru » Wed Oct 27, 2021 5:36 pm

The optimal configuration usually means using the nearest time servers and turning off unneeded features.
You can compare /etc/ntp.conf from other distributions with that from archlinuxarm ('pool' from ubuntu equals to 'server' from arch and so on). And compare the results obtained by ntpq -p
$this->bbcode_second_pass_quote('claus', ' ')records nonsense time -not the last time and date from the shutdown time
There is a high chance that no application is recording the previous system time; fake-hwclock is not installed by default
armuseru
 
Posts: 34
Joined: Sat Jan 09, 2021 9:36 am

Re: wrong time and date after reboot

Postby claus » Thu Oct 28, 2021 7:27 am

I cannot compare buster or ubuntu with archlinux because there are running systemd-timesyncd. and on archlinux ntpd. On archlinux I would like to go a different way to gain new experiences.
claus
 
Posts: 9
Joined: Thu Oct 21, 2021 7:26 am

Re: wrong time and date after reboot

Postby armuseru » Thu Oct 28, 2021 5:00 pm

chrony can also be an alternative https://wiki.archlinux.org/title/Chrony
armuseru
 
Posts: 34
Joined: Sat Jan 09, 2021 9:36 am

Re: wrong time and date after reboot

Postby claus » Fri Oct 29, 2021 12:52 pm

i will try it
claus
 
Posts: 9
Joined: Thu Oct 21, 2021 7:26 am


Return to ARMv7h

Who is online

Users browsing this forum: No registered users and 5 guests