systemd/man/systemd-timedated.service.xml
Zbigniew Jędrzejewski-Szmek afaae43bb1 timedated: add back support for ntp-units.d/
We removed support for foreign services (and ntp-units.d/) in b72ddf0f4.
Support for foreign services was added back in 5d280742, but through an
environment variable.

The problem with the env var approach is that it only works as a mechanism
to select one item, and doesn't work nicely as a mechinism to create a list
of items through drop-ins (because the env var can be easily overridden, but not
extended). Having a list of "ntp providers" is important to be able to reliably disable
all of them when that is requested.

Another problem is that nobody ever bothered to care about our new "standard".
ntp-units.d/ is a nice simple format that works and is already supported by
chrony and ntpd and timedatex. If we were to introduce and ask people to follow
a new standard, there should be some good reason for this. The idea with env
vars has lower functionality, requires systemd-specific syntax. We should just
re-adopt the format that we originally introduced and that seems to work for
everyone, and more on to more interesting problems.
2019-07-22 15:21:20 +02:00

91 lines
4.1 KiB
XML

<?xml version='1.0'?> <!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!-- SPDX-License-Identifier: LGPL-2.1+ -->
<refentry id="systemd-timedated.service" conditional='ENABLE_TIMEDATED'>
<refentryinfo>
<title>systemd-timedated.service</title>
<productname>systemd</productname>
</refentryinfo>
<refmeta>
<refentrytitle>systemd-timedated.service</refentrytitle>
<manvolnum>8</manvolnum>
</refmeta>
<refnamediv>
<refname>systemd-timedated.service</refname>
<refname>systemd-timedated</refname>
<refpurpose>Time and date bus mechanism</refpurpose>
</refnamediv>
<refsynopsisdiv>
<para><filename>systemd-timedated.service</filename></para>
<para><filename>/usr/lib/systemd/systemd-timedated</filename></para>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><filename>systemd-timedated</filename> is a system service
that may be used as a mechanism to change the system clock and
timezone, as well as to enable/disable network time synchronization.
<filename>systemd-timedated</filename> is automatically activated
on request and terminates itself when it is unused.</para>
<para>The tool
<citerefentry><refentrytitle>timedatectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
is a command line client to this service.</para>
<para>See the <ulink
url="https://www.freedesktop.org/wiki/Software/systemd/timedated">
developer documentation</ulink> for information about the APIs
<filename>systemd-timedated</filename> provides.</para>
</refsect1>
<refsect1>
<title>List of network time synchronization services</title>
<para><command>systemd-timesyncd</command> will look for files with a <literal>.list</literal> extension
in <filename>ntp-units.d/</filename> directories. Each file is parsed as a list of unit names, one per
line. Empty lines and lines with comments (<literal>#</literal>) are ignored. Files are read from
<filename>/usr/lib/systemd/ntp-units.d/</filename> and the corresponding directories under
<filename>/etc/</filename>, <filename>/run/</filename>, <filename>/usr/local/lib/</filename>. Files in
<filename>/etc/</filename> override files with the same name in <filename>/run/</filename>,
<filename>/usr/local/lib/</filename>, and <filename>/usr/lib/</filename>. Files in
<filename>/run/</filename> override files with the same name under <filename>/usr/</filename>. Packages
should install their configuration files in <filename>/usr/lib/</filename> (distribution packages) or
<filename>/usr/local/lib/</filename> (local installs).</para>
<example>
<title><filename>ntp-units.d/</filename> entry for <command>systemd-timesyncd</command></title>
<programlisting># /usr/lib/systemd/ntp-units.d/80-systemd-timesync.list
systemd-timesyncd.service
</programlisting>
</example>
<para>If the environment variable <varname>$SYSTEMD_TIMEDATED_NTP_SERVICES</varname> is set,
<command>systemd-timesyncd</command> will parse the contents of that variable as a colon-separated list
of unit names. When set, this variable overrides the file-based list described above.</para>
<example>
<title>An override that specifies that <command>chronyd</command> should be used if available</title>
<programlisting>SYSTEMD_TIMEDATED_NTP_SERVICES=chronyd.service:systemd-timesyncd.service</programlisting>
</example>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>timedatectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-timesyncd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>