From 1431b2f701f7ba71e5d8664e709b1fad26797918 Mon Sep 17 00:00:00 2001 From: Alexander Batischev Date: Sat, 19 Dec 2020 14:17:49 +0300 Subject: [PATCH] man: Advertise systemd-time-wait-sync.service more (#17729) * man: Advertise systemd-time-wait-sync.service more The description of time-sync.target says that NTP services *should* pull that target, but doesn't mention that e.g. systemd-timesyncd.service doesn't actually do that. As a result, time-sync.target is reached way earlier than people expect; see #5097, #8861, #11008. systemd provides systemd-time-wait-sync.service to ameliorate this problem, but doesn't feature it prominently in relevant manpages. In fact, it's only mentioned in passing in systemd-timesyncd.service(8). As a result, I ended up re-implementing that service, and I'm not the first one: https://github.com/NixOS/nixpkgs/pull/51338 This patch adds a mention right in the description of time-sync.target, which will hopefully raise awareness of this helper service. --- man/systemd.special.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/man/systemd.special.xml b/man/systemd.special.xml index a70e9ee0ca..1977157f9e 100644 --- a/man/systemd.special.xml +++ b/man/systemd.special.xml @@ -1018,7 +1018,16 @@ in. systemd automatically adds dependencies of type After= for this target unit to all SysV init script service units with an LSB header referring to - the $time facility. + the $time facility, and also to all timer + units with at least one OnCalendar= + directive. + + This target might get reached before the clock is actually synchronized to an accurate reference + clock. To prevent that, enable + systemd-time-wait-sync.service8 + if you're using + systemd-timesyncd.service8, + or an equivalent service for other NTP implementations.