uname -a? Linux DietPi 3.4.113-sun8i #18 SMP PREEMPT Thu Jun 15 02:16:06 CEST 2017 armv7l GNU/LinuxSelecting 'daemon + drift' as time syncronization method sets the correct date time
Date / Time is not being set correctly. Daemon does not seem to be running.
When creating a new image, in the dietpi setup configuration file, select 'Daemon + Drift' as ntp method.
dietpi-bugreport?31ce7a2b-3cd9-4754-a9b4-24ac5eba4b88-0
A message relating to ntp is seen during setup indicating it has been successful.
On a fresh install as tzdata is installed the following message is seen (indicating date/time has not been set)
Current default time zone: 'Europe/London'
Local time is now: Sat Mar 11 12:16:44 GMT 2017.
Universal Time is now: Sat Mar 11 12:16:44 UTC 2017.
Run 'dpkg-reconfigure tzdata' if you wish to change it.
Not sure what should be running as the daemon but there is no sign of ntpd or systemd-timesyncd
Package ntp is installed.
It seems reasonable to use systemd-timesyncd
root@DietPi:/lib/systemd/system# systemctl status systemd-timesyncd.service
โ systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; disabled)
Active: inactive (dead)
Docs: man:systemd-timesyncd.service(8)
systemctl enable systemd-timesyncd.servicesystemctl start systemd-timesyncd.serviceroot@DietPi:/usr/sbin# timedatectl status
Local time: Sun 2017-10-22 09:33:52 BST
Universal time: Sun 2017-10-22 08:33:52 UTC
RTC time: Thu 1970-01-01 00:34:09
Time zone: Europe/London (BST, +0100)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: yes
Last DST change: DST began at
Sun 2017-03-26 00:59:59 GMT
Sun 2017-03-26 02:00:00 BST
Next DST change: DST ends (the clock jumps one hour backwards) at
Sun 2017-10-29 01:59:59 BST
Sun 2017-10-29 01:00:00 GMT
timedatectl set-ntp trueReference used [(https://feeding.cloud.geek.nz/posts/time-synchronization-with-ntp-and-systemd/)] although he intimates that ntp cannot be installed alongside systemd-timesyncd.
Jep, choosing 'Daemon + Drift' doesn't seem to have any effect. No service/process of ntp can be found active.
Quick test on Odroid C2, unable to replicate:
root@DietPi:~# timedatectl status
Local time: Thu 2017-11-09 20:02:34 GMT
Universal time: Thu 2017-11-09 20:02:34 UTC
RTC time: n/a
Time zone: Europe/London (GMT, +0000)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: no
Last DST change: DST ended at
Sun 2017-10-29 01:59:59 BST
Sun 2017-10-29 01:00:00 GMT
Next DST change: DST begins (the clock jumps one hour forward) at
Sun 2018-03-25 00:59:59 GMT
Sun 2018-03-25 02:00:00 BST

Could be specific to our OPi Zero image.
dbus need to be installed for systemd to initiate systemd-timesyncdntp is still installed and active: https://superuser.com/questions/938926/systemd-timesyncd-service-start-fails/usr/sbin/ntpd is present.https://feeding.cloud.geek.nz/posts/time-synchronization-with-ntp-and-systemd/
In any case the ntp package is not necessary anymore, so should be purged if timesyncd is used, and pool server can be changed via /etc/systemd/timesyncd.
@MichaIng
Great find ๐
But on Stretch, it fails if ntp is still installed and active:
In any case the ntp package is not necessary anymore, so should be purged if timesyncd is used
So in theory, we could simply apt-get purge ntp when user selects daemon + drift, and visa versa, reinstall as needed?
Jep, this also works on Jessie and we can keep installation slim this way. ntp pools need to be set in /etc/systemd/timesyncd.conf then.
But in terms of memory consumption ntp called by cron is still the preferred way, as systemd-timesyncd consumes up to 5M on my VMs + additional dbus memory.
@MichaIng
๐ I'll add this to v159 milestone
It has been suggested to me that timesyncd may not work on a Read Only filesystem https://community.openenergymonitor.org/t/ensuring-emonpi-emonbase-time-is-synchronised-with-an-ntp-server/5487/11
Not sure if this is useful information or not.
Tested 2 > 4 > 0 > 2 > after all commits on:
Works great, also tested with Jessie and Stretch VMs back and forth ๐.
@MichaIng
Excellent ๐
I'll mark this as completed.