]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man: Advertise systemd-time-wait-sync.service more (#17729)
authorAlexander Batischev <eual.jp@gmail.com>
Sat, 19 Dec 2020 11:17:49 +0000 (14:17 +0300)
committerGitHub <noreply@github.com>
Sat, 19 Dec 2020 11:17:49 +0000 (11:17 +0000)
* 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

index a70e9ee0cae83b5b88fa64b921bfc1d03b377a7c..1977157f9e9c003c204e6a1c600e48c18520c983 100644 (file)
             in. systemd automatically adds dependencies of type
             <varname>After=</varname> for this target unit to all SysV
             init script service units with an LSB header referring to
-            the <literal>$time</literal> facility. </para>
+            the <literal>$time</literal> facility, and also to all timer
+            units with at least one <varname>OnCalendar=</varname>
+            directive. </para>
+
+            <para>This target might get reached before the clock is actually synchronized to an accurate reference
+            clock. To prevent that, enable
+            <citerefentry><refentrytitle>systemd-time-wait-sync.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+            if you're using
+            <citerefentry><refentrytitle>systemd-timesyncd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+            or an equivalent service for other NTP implementations.</para>
           </listitem>
         </varlistentry>
       </variablelist>