summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-07-21 15:06:35 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-07-22 15:21:20 +0200
commitafaae43bb191dc187a366fc3595b6b4e34039acf (patch)
tree2e8b9b2d2129133b151695c6bd438ad6bd102415 /man
parent670fb0b48360c856f0054fa16fc849fc4f2dbf07 (diff)
downloadsystemd-afaae43bb191dc187a366fc3595b6b4e34039acf.tar.gz
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.
Diffstat (limited to 'man')
-rw-r--r--man/systemd-timedated.service.xml49
-rw-r--r--man/timedatectl.xml31
2 files changed, 45 insertions, 35 deletions
diff --git a/man/systemd-timedated.service.xml b/man/systemd-timedated.service.xml
index 3626e8bc51..f981848cb2 100644
--- a/man/systemd-timedated.service.xml
+++ b/man/systemd-timedated.service.xml
@@ -31,7 +31,7 @@
<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 NTP time synchronization.
+ 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>
@@ -46,25 +46,36 @@
</refsect1>
<refsect1>
- <title>Environment</title>
-
- <variablelist class='environment-variables'>
- <varlistentry>
- <term><varname>$SYSTEMD_TIMEDATED_NTP_SERVICES</varname></term>
-
- <listitem><para>Colon-separated list of unit names of NTP client services.
- If not set, then
- <citerefentry><refentrytitle>systemd-timesyncd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
- is used. See the entries of NTP related commands of
- <citerefentry><refentrytitle>timedatectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
- for details about this.</para>
-
- <para>Example:
- <programlisting>SYSTEMD_TIMEDATED_NTP_SERVICES=ntpd.service:chronyd.service:systemd-timesyncd.service</programlisting>
- </para></listitem>
- </varlistentry>
- </variablelist>
+ <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>
diff --git a/man/timedatectl.xml b/man/timedatectl.xml
index 262b9126e7..f797e0cd67 100644
--- a/man/timedatectl.xml
+++ b/man/timedatectl.xml
@@ -23,22 +23,25 @@
<refsynopsisdiv>
<cmdsynopsis>
- <command>timedatectl <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="req">COMMAND</arg></command>
+ <command>timedatectl</command>
+ <arg choice="opt" rep="repeat">OPTIONS</arg>
+ <arg choice="req">COMMAND</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
- <para><command>timedatectl</command> may be used to query and
- change the system clock and its settings.</para>
+ <para><command>timedatectl</command> may be used to query and change the system clock and its settings,
+ and enable or disable time synchronization services.</para>
<para>Use
<citerefentry><refentrytitle>systemd-firstboot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
to initialize the system time zone for mounted (but not booted)
system images.</para>
- <para><command>timedatectl</command> may be used to show the current status of
+ <para><command>timedatectl</command> may be used to show the current status of time synchronization
+ services, for example
<citerefentry><refentrytitle>systemd-timesyncd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
</para>
@@ -123,11 +126,8 @@
<varlistentry>
<term><command>status</command></term>
- <listitem><para>Show current settings of the system clock and RTC,
- including whether network time synchronization through
- <filename>systemd-timesyncd.service</filename> is active. Even if it is
- inactive, a different service might still synchronize the clock.
- If no command is specified, this is the implied default.
+ <listitem><para>Show current settings of the system clock and RTC, including whether network time
+ synchronization is active. If no command is specified, this is the implied default.
</para></listitem>
</varlistentry>
@@ -193,11 +193,11 @@
<varlistentry>
<term><command>set-ntp [BOOL]</command></term>
- <listitem><para>Takes a boolean argument. Controls whether network time synchronization is active
- and enabled (if available). If the argument is true, this enables and starts the first existed
- service listed in the environment variable <varname>$SYSTEMD_TIMEDATED_NTP_SERVICES</varname>
- of <filename>systemd-timedated.service</filename>. If the argument is false, then this disables and
- stops the all services listed in <varname>$SYSTEMD_TIMEDATED_NTP_SERVICES</varname>.</para></listitem>
+ <listitem><para>Takes a boolean argument. Controls whether network time synchronization is active and
+ enabled (if available). If the argument is true, this enables and starts the first existing network
+ synchronization service. If the argument is false, then this disables and stops the known network
+ synchronization services. The way that the list of services is built is described below.</para>
+ </listitem>
</varlistentry>
</variablelist>
@@ -250,8 +250,7 @@
<refsect1>
<title>Exit status</title>
- <para>On success, 0 is returned, a non-zero failure
- code otherwise.</para>
+ <para>On success, 0 is returned, a non-zero failure code otherwise.</para>
</refsect1>
<xi:include href="less-variables.xml" />