NTP: My Arch Raspi always thinks it's February

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

NTP: My Arch Raspi always thinks it's February

Postby kalsan » Fri Jun 02, 2017 12:10 pm

Hi there,
At every reboot, my Raspberry Pi 3 running Arch Linux ARM thinks that it's February. The Rapi has no RTC module.
Here's the result of a few experiments, the behaviour can be repeated at every reboot.

$this->bbcode_second_pass_code('', '
--- REBOOT ---
[user@raspberry-pi-3 ~]$ date
Mit Feb 1 02:12:34 CET 2017
[user@raspberry-pi-3 ~]$ timedatectl
Local time: Mit 2017-02-01 02:12:41 CET
Universal time: Mit 2017-02-01 01:12:41 UTC
RTC time: n/a
Time zone: Europe/Zurich (CET, +0100)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no
[user@raspberry-pi-3 ~]$ date
Mit Feb 1 02:12:47 CET 2017
[user@raspberry-pi-3 ~]$ sudo timedatectl set-ntp true
[sudo] Passwort für user:
[user@raspberry-pi-3 ~]$ timedatectl
Local time: Mit 2017-02-01 02:13:51 CET
Universal time: Mit 2017-02-01 01:13:51 UTC
RTC time: n/a
Time zone: Europe/Zurich (CET, +0100)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no
[user@raspberry-pi-3 ~]$ date
Mit Feb 1 02:13:56 CET 2017
[user@raspberry-pi-3 ~]$ ntpq -c lpeer
remote refid st t when poll reach delay offset jitter
==============================================================================
ntp1.ams1.nl.le 130.133.1.10 2 u 3 64 1 40.609 0.313 0.001
loonquawl.0x2a. 161.143.24.141 2 u 4 64 1 14.028 -0.625 0.001
bart.nexellent. 194.242.34.149 2 u 3 64 1 12.507 0.015 0.001
metasntp12.admi .MRS. 1 u 4 64 1 14.908 -0.161 0.001
[user@raspberry-pi-3 ~]$ timedatectl
Local time: Fre 2017-06-02 13:45:58 CEST
Universal time: Fre 2017-06-02 11:45:58 UTC
RTC time: n/a
Time zone: Europe/Zurich (CEST, +0200)
Network time on: yes
NTP synchronized: no
RTC in local TZ: no
[user@raspberry-pi-3 ~]$ date
Fre Jun 2 13:46:01 CEST 2017
')

Any ideas on how to debug this?
Cheers,
Kalsan
kalsan
 
Posts: 5
Joined: Sun Mar 27, 2016 8:31 am

Re: NTP: My Arch Raspi always thinks it's February

Postby summers » Fri Jun 02, 2017 12:22 pm

$this->bbcode_second_pass_code('', 'ntpq -p')
Should list the peers, there used to be a command to see how time compared to the peers - but think now ntp is taken into systemd its maybe not so easy. My guess is that you aren't sinking to your peers...

Edit: Ah just scrolled down you window. So you are synced to your peers, so the date being wrong is very odd ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: NTP: My Arch Raspi always thinks it's February

Postby kalsan » Sat Jun 03, 2017 7:36 am

Yeah, "odd" is a pretty good name for the behaviour I guess. Most interestingly it always starts up with Feb 1, 2017, 2 AM. If it was Jan 1, 1970 I'd understand, but this just seems to make no sence.

The sync state looks fine though:

$this->bbcode_second_pass_code('', '$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
v.bsod.fr 193.79.237.14 2 u 54 64 3 52.050 1056363 1.765
arthur.testserv 162.23.41.56 2 u 52 64 3 12.359 1056363 1.755
vpn88.smart-met 192.53.103.103 2 u 54 64 3 22.172 1056363 0.211
ntp0.as34288.ne 85.158.25.74 2 u 54 64 3 13.515 1056363 0.283
')

Actually, I observed that the date eventually gets right after a while. However, the startup of the time service takes a very long time. For this reason, logs become unusable.
kalsan
 
Posts: 5
Joined: Sun Mar 27, 2016 8:31 am

Re: NTP: My Arch Raspi always thinks it's February

Postby graysky » Sat Jun 03, 2017 12:10 pm

Why ntpd? systemd-timesyncd is the default and is part of systemd (required).
graysky
Developer
 
Posts: 1731
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: NTP: My Arch Raspi always thinks it's February

Postby summers » Sat Jun 03, 2017 1:00 pm

ntpq probes how your time relates to ntp time. Its the original ntp implementation and has more functionallity than the systemd simple set up. So helps in understanding of what is going wrong in syncing time. Here the behaviour is odd, it thinks it is syncronsed to ntp time, but time reported is very odd.

Actualkly offset above is huge - so second time ntpd was run it saw a problem. Something like 20 minutes out ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: NTP: My Arch Raspi always thinks it's February

Postby kalsan » Sun Jun 04, 2017 10:50 am

Here's my /etc/ntp.conf:
$this->bbcode_second_pass_code('', '
# Please consider joining the pool:
#
# http://www.pool.ntp.org/join.html
#
# For additional information see:
# - https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon
# - http://support.ntp.org/bin/view/Support/GettingStarted
# - the ntp.conf man page

# Associate to Arch's NTP pool
server 0.arch.pool.ntp.org
server 1.arch.pool.ntp.org
server 2.arch.pool.ntp.org
server 3.arch.pool.ntp.org

# By default, the server allows:
# - all queries from the local host
# - only time queries from remote hosts, protected by rate limiting and kod
restrict default kod limited nomodify nopeer noquery notrap
restrict 127.0.0.1
restrict ::1

# Location of drift file
driftfile /var/lib/ntp/ntp.drift

')

Here's my /var/lib/ntp/ntp.drift:
$this->bbcode_second_pass_code('', '-5.170')
kalsan
 
Posts: 5
Joined: Sun Mar 27, 2016 8:31 am


Return to ARMv7h

Who is online

Users browsing this forum: No registered users and 4 guests