Hello my dears,
my time synchronization is not running correctly on an OpenWrt router. On my second OpenWrt router everything is correct. Both configurations are identical. The 1 router has a time deviation of -1 hour. Here are the router configurations:
Router 1
# uci show system
...
system.@system[0].zonename='Europe/Berlin'
system.@system[0].timezone='CET-1CEST,M3.5.0,M10.5.0/3'
system.ntp=timeserver
system.ntp.enabled='1'
system.ntp.server='dsme01.intern.example.com' '1.openwrt.pool.ntp.org' '2.openwrt.pool.ntp.org' '3.openwrt.pool.ntp.org'
...
# cat /etc/TZ
CET-1CEST,M3.5.0,M10.5.0/3
# date
Sun Jan 6 22:54:47 UTC 2019
# ps | grep ntp
4675 root 14820 S /usr/sbin/ntpclient -i 600 -s -l -D -p 123 -h dsme01.intern.example.com
5822 root 16536 S< /usr/sbin/ntpd -n -N -S /usr/sbin/ntpd-hotplug -p dsme01.intern.example.com -p 1.openwrt.pool.ntp.org -p 2.openwrt.pool.ntp
5982 root 14464 S grep ntp
Router 2
# uci show system
...
system.@system[0].zonename='Europe/Berlin'
system.@system[0].timezone='CET-1CEST,M3.5.0,M10.5.0/3'
system.ntp=timeserver
system.ntp.enabled='1'
system.ntp.server='dsme01.intern.example.com' '1.openwrt.pool.ntp.org' '2.openwrt.pool.ntp.org' '3.openwrt.pool.ntp.org'
...
# cat /etc/TZ
CET-1CEST,M3.5.0,M10.5.0/3
# date
Sun Jan 6 23:54:40 CET 2019
# ps | grep ntp
1485 root 912 S /usr/sbin/ntpclient -i 600 -s -l -D -p 123 -h dsme01.intern.example.com
1881 root 1200 S< /usr/sbin/ntpd -n -N -S /usr/sbin/ntpd-hotplug -p dsme01.intern.example.com -p 1.openwrt.pool.ntp.org -p 2.openwrt.pool.ntp
2029 root 1200 S grep ntp
Why is the time on Router 1 incorrect? Why does the date command display "UTC"?
If you had read the first post, then you would have seen that the time zone of both routers are correct. This proposal has not brought a solution. See image.
Do I have to be in the kernel_menuconfig a clock source timer?
My understanding is that the kernel always keeps time as UTC, then user space functions modify it to local time. In both routers the kernel's UTC is correct.
Though this is somewhat a cop-out to your problems with getting local time, I will point out that it is traditional and pragmatic to set network devices and servers to UTC.
The Router 1 is a APU1D4 with Hardware Clock. Version OpenWrt 18.06-SNAPSHOT r7407-1cd945ea22
The Router 2 is a TP-Link Archer C7 v2. Version LEDE Reboot SNAPSHOT r5327-e2f25e6
Since the router 2 synchronized the time properly, I'm still waiting with the update until I found the problem on the router 1. Only then I create the new firmware version 18.06.
when you run "date --version" what do you get on the two ? (yes I know the busybox date doesn't have a --version but it does output info about itself if you give it invalid options )
If I put all routers and servers on UTC then the local time is not correct any more and I get many synchronization problems (OpenLDAP, MariaDB, (DNS & DHCP runs also in the OpenLDAP)). This really is not a good approach.
I think it is related to my hardware clock on the router 1 of the APU1D4 board. I am currently compiling hwclock and RTC support for the kernel. Mak, see if that helps. I think my hardware clock on the board is wrong.