From b6f89490bb8cebc087140af940c876124bd78263 Mon Sep 17 00:00:00 2001 From: "Peter A. Bigot" Date: Mon, 9 Apr 2018 13:39:16 -0500 Subject: time-wait-sync: use watchfile to coordinate with timesyncd Systems that have an accurate real-time clock may have an initial unsynchronized time that is close enough to the synchronized time that the final adjustment doesn't trigger a waking "clock set" event. Have timesyncd touch a file in its runtime directory as a secondary signal for synchronization. Continue to support the timerfd-based trigger as a sufficient condition when the watchfile is not present. Closes issue #8683 --- man/elogind-time-wait-sync.service.xml | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'man/elogind-time-wait-sync.service.xml') diff --git a/man/elogind-time-wait-sync.service.xml b/man/elogind-time-wait-sync.service.xml index 559379b2e..b3e158ce6 100644 --- a/man/elogind-time-wait-sync.service.xml +++ b/man/elogind-time-wait-sync.service.xml @@ -46,24 +46,30 @@ Description elogind-time-wait-sync is a system service that delays the start of units that depend on - time-sync.target until elogind-timesyncd.service or something else has - set the system time and marked it as synchronized. Reaching this state generally requires synchronization with an - external source, such as an NTP server. + time-sync.target until the system time has been synchronized with an accurate time source by + elogind-timesyncd.service. - When this unit is not enabled the time-sync.target synchronization point may be reached - as soon as the system time is advanced by elogind-timesyncd.service to the time stored at the - last shutdown. That time may not meet the expectations of dependent services that require an accurate - clock. + elogind-timesyncd.service notifies on successful synchronization. + elogind-time-wait-sync also tries to detect when the kernel marks the time as synchronized, + but this detection is not reliable and is intended only as a fallback for other servies that can be used to + synchronize time (e.g., ntpd, chronyd). - Notes + Files + + + + /run/systemd/timesync/synchronized + + + The presence of this file indicates to this service that the system clock has been synchronized. + + + + - This service works correctly with a time synchronization service like - elogind-timesyncd.service that uses the same protocol as NTP to set the time from a - synchronized source. When used with time synchronization services that follow a different protocol the event of - setting synchronized time may not be detected in which case this service will not complete. -- cgit v1.2.3