summaryrefslogtreecommitdiffstats
path: root/src/timesync/timesyncd-manager.c
diff options
context:
space:
mode:
authorPeter A. Bigot <pab@pabigot.com>2018-04-09 20:39:16 +0200
committerPeter A. Bigot <pab@pabigot.com>2018-04-14 16:52:40 +0200
commit2dd79846ddd5f31aaf178eb3457677139e38fac0 (patch)
tree4cb0f47df662847dbee21579cb56a3e798ba14e6 /src/timesync/timesyncd-manager.c
parentunits: leave systemd-time-wait-sync disabled by default (diff)
downloadsystemd-2dd79846ddd5f31aaf178eb3457677139e38fac0.tar.xz
systemd-2dd79846ddd5f31aaf178eb3457677139e38fac0.zip
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
Diffstat (limited to 'src/timesync/timesyncd-manager.c')
-rw-r--r--src/timesync/timesyncd-manager.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
index cfdc43b0ff..5b26baf39b 100644
--- a/src/timesync/timesyncd-manager.c
+++ b/src/timesync/timesyncd-manager.c
@@ -355,6 +355,7 @@ static int manager_adjust_clock(Manager *m, double offset, int leap_sec) {
/* If touch fails, there isn't much we can do. Maybe it'll work next time. */
(void) touch("/var/lib/systemd/timesync/clock");
+ (void) touch("/run/systemd/timesync/synchronized");
m->drift_ppm = tmx.freq / 65536;