[pkg-ntp-maintainers] Bug#856343: ntpdate: tell kernel time is synced
Daniel Pocock
daniel at pocock.pro
Tue Feb 28 09:02:04 UTC 2017
Package: ntpdate
Version: 1:4.2.8p9+dfsg-2.1
Severity: important
In recent distributions using systemd, including Debian, the hardware
clock is not updated from the UNIX clock during shutdown.
Therefore, if somebody uses ntpdate to sync their clock, either manually
or from cron or other means and then they shutdown or reboot, the system
may not have the most accurate time.
As previous releases of Debian did store the time to the hardware clock
during shutdown, users may well be expecting this behavior and may be
surprised that it doesn't happen.
There appear to be a few things that could be done in ntpdate:
- it could clear the STA_UNSYNC flag when setting the time, so the
kernel will automatically update the hardware clock. This also depends
on the kernel being compiled with certain flags enabled, this is the
approach assumed by systemd.
- if not using STA_UNSYNC, it could add an option for explicitly
invoking "hwclock --systohc" from ntpdate and if the user doesn't
specify that option, it could emit some warning to the console that the
hardware clock will never be updated at shutdown
- or it could just log a warning without any attempt to do the sync
Discussed on debian-devel[1]
1. https://lists.debian.org/debian-devel/2017/02/msg00634.html
More information about the pkg-ntp-maintainers
mailing list