]>
Commit | Line | Data |
---|---|---|
a91df40e | 1 | <?xml version='1.0'?> <!--*-nxml-*--> |
3a54a157 | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
12b42c76 | 3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> |
db9ecf05 | 4 | <!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
a91df40e | 5 | |
4623eecb AK |
6 | <refentry id="systemd-timesyncd.service" conditional='ENABLE_TIMESYNCD' |
7 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
a91df40e | 8 | |
798d3a52 ZJS |
9 | <refentryinfo> |
10 | <title>systemd-timesyncd.service</title> | |
11 | <productname>systemd</productname> | |
798d3a52 ZJS |
12 | </refentryinfo> |
13 | ||
14 | <refmeta> | |
15 | <refentrytitle>systemd-timesyncd.service</refentrytitle> | |
16 | <manvolnum>8</manvolnum> | |
17 | </refmeta> | |
18 | ||
19 | <refnamediv> | |
20 | <refname>systemd-timesyncd.service</refname> | |
21 | <refname>systemd-timesyncd</refname> | |
22 | <refpurpose>Network Time Synchronization</refpurpose> | |
23 | </refnamediv> | |
24 | ||
25 | <refsynopsisdiv> | |
26 | <para><filename>systemd-timesyncd.service</filename></para> | |
12b42c76 | 27 | <para><filename>/usr/lib/systemd/systemd-timesyncd</filename></para> |
798d3a52 ZJS |
28 | </refsynopsisdiv> |
29 | ||
30 | <refsect1> | |
31 | <title>Description</title> | |
32 | ||
b149d230 LP |
33 | <para><filename>systemd-timesyncd</filename> is a system service that may be used to synchronize the |
34 | local system clock with a remote Network Time Protocol (NTP) server. It also saves the local time to disk | |
35 | every time the clock has been synchronized and uses this to possibly advance the system realtime clock on | |
36 | subsequent reboots to ensure it (roughly) monotonically advances even if the system lacks a | |
37 | battery-buffered RTC chip.</para> | |
38 | ||
39 | <para>The <filename>systemd-timesyncd</filename> service implements SNTP only. This minimalistic service | |
40 | will step the system clock for large offsets or slowly adjust it for smaller deltas. Complex use cases | |
41 | that require full NTP support (and where SNTP is not sufficient) are not covered by | |
42 | <filename>systemd-timesyncd</filename>.</para> | |
43 | ||
44 | <para>The NTP servers contacted are determined from the global settings in | |
45 | <citerefentry><refentrytitle>timesyncd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, the | |
46 | per-link static settings in <filename>.network</filename> files, and the per-link dynamic settings | |
47 | received over DHCP. See | |
48 | <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry> for | |
49 | further details.</para> | |
8731be1a LP |
50 | |
51 | <para><citerefentry><refentrytitle>timedatectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s | |
b149d230 LP |
52 | <command>set-ntp</command> command may be used to enable and start, or disable and stop this |
53 | service.</para> | |
1e4acc77 YW |
54 | |
55 | <para><citerefentry><refentrytitle>timedatectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s | |
56 | <command>timesync-status</command> or <command>show-timesync</command> command can be used to show the | |
57 | current status of this service.</para> | |
b149d230 LP |
58 | |
59 | <para><filename>systemd-timesyncd</filename> initialization delays the start of units that are ordered | |
60 | after <filename>time-set.target</filename> (see | |
61 | <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry> for | |
62 | details) until the local time has been updated from <filename>/var/lib/systemd/timesync/clock</filename> | |
57b3b8f4 LP |
63 | (see below) in order to make it roughly monotonic. It does not delay other units until synchronization |
64 | with an accurate reference time sources has been reached. Use | |
b149d230 LP |
65 | <citerefentry><refentrytitle>systemd-time-wait-sync.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
66 | to achieve that, which will delay start of units that are ordered after | |
67 | <filename>time-sync.target</filename> until synchronization to an accurate reference clock is | |
68 | reached.</para> | |
798d3a52 ZJS |
69 | </refsect1> |
70 | ||
71 | <refsect1> | |
72 | <title>Files</title> | |
73 | ||
74 | <variablelist> | |
75 | <varlistentry> | |
53d133ea | 76 | <term><filename>/var/lib/systemd/timesync/clock</filename></term> |
798d3a52 ZJS |
77 | |
78 | <listitem> | |
2efddcb2 LP |
79 | <para>The modification time ("mtime") of this file is updated on each successful NTP |
80 | synchronization or after each <varname>SaveIntervalSec=</varname> time interval, as specified in | |
81 | <citerefentry><refentrytitle>timesyncd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> | |
82 | ||
83 | <para>When initializing, the local clock is advanced to the modification time of this file (if the | |
84 | file timestamp is in the past this adjustment is not made). If the file does not exist yet, the | |
85 | clock is instead advanced to the modification time of <filename>/usr/lib/clock-epoch</filename> – | |
86 | if it exists – or to a time derived from the source tree at build time. This mechanism is used to | |
87 | ensure that the system clock remains somewhat reasonably initialized and roughly monotonic across | |
88 | reboots, in case no battery-buffered local RTC is available.</para> | |
ec07c3c8 AK |
89 | |
90 | <xi:include href="version-info.xml" xpointer="v235"/> | |
798d3a52 ZJS |
91 | </listitem> |
92 | </varlistentry> | |
2dd79846 | 93 | |
2efddcb2 LP |
94 | <varlistentry> |
95 | <term><filename>/usr/lib/clock-epoch</filename></term> | |
96 | ||
97 | <listitem><para>The modification time ("mtime") of this file is used for advancing the system clock | |
98 | in case <filename>/var/lib/systemd/timesync/clock</filename> does not exist yet, see | |
ec07c3c8 AK |
99 | above.</para> |
100 | ||
101 | <xi:include href="version-info.xml" xpointer="v254"/></listitem> | |
2efddcb2 LP |
102 | </varlistentry> |
103 | ||
2dd79846 PB |
104 | <varlistentry> |
105 | <term><filename>/run/systemd/timesync/synchronized</filename></term> | |
106 | ||
107 | <listitem> | |
108 | <para>A file that is touched on each successful synchronization, to assist | |
109 | <filename>systemd-time-wait-sync</filename> and other applications to detecting synchronization | |
b149d230 | 110 | with accurate reference clocks.</para> |
ec07c3c8 AK |
111 | |
112 | <xi:include href="version-info.xml" xpointer="v239"/> | |
2dd79846 PB |
113 | </listitem> |
114 | ||
115 | </varlistentry> | |
798d3a52 ZJS |
116 | </variablelist> |
117 | </refsect1> | |
118 | ||
119 | <refsect1> | |
120 | <title>See Also</title> | |
121 | <para> | |
122 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
123 | <citerefentry><refentrytitle>timesyncd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
124 | <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
125 | <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
2dd79846 | 126 | <citerefentry><refentrytitle>systemd-time-wait-sync.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
b149d230 | 127 | <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>, |
798d3a52 ZJS |
128 | <citerefentry><refentrytitle>timedatectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
129 | <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
130 | <citerefentry project='man-pages'><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
131 | </para> | |
132 | </refsect1> | |
a91df40e KS |
133 | |
134 | </refentry> |