mirror of
https://github.com/systemd/systemd.git
synced 2025-03-28 02:50:16 +03:00
units: add time-set.target
time-sync.target is supposed to indicate system clock is synchronized with a remote clock, but as used through 241 it only provided a system clock that was updated based on a locally-maintained timestamp. Systems that are powered off for extended periods would not come up with accurate time. Retain the existing behavior using a new time-set.target leaving time-sync.target for cases where accuracy is required. Closes #8861
This commit is contained in:
parent
82d0776da2
commit
4ea0f675ae
@ -77,6 +77,7 @@
|
||||
<filename>sysinit.target</filename>,
|
||||
<filename>system-update.target</filename>,
|
||||
<filename>system-update-pre.target</filename>,
|
||||
<filename>time-set.target</filename>,
|
||||
<filename>time-sync.target</filename>,
|
||||
<filename>timers.target</filename>,
|
||||
<filename>umount.target</filename>,
|
||||
@ -950,6 +951,18 @@
|
||||
the <literal>$portmap</literal> facility.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><filename>time-set.target</filename></term>
|
||||
<listitem>
|
||||
<para>Services responsible for setting the system clock from
|
||||
a local source (such as a maintained timestamp file or
|
||||
imprecise real-time clock) should pull in this target and
|
||||
order themselves before it. Services where approximate time
|
||||
is desired should be ordered after this unit, but not pull
|
||||
it in. This target does not provide the accuracy guarantees
|
||||
of <filename>time-sync.target</filename>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><filename>time-sync.target</filename></term>
|
||||
<listitem>
|
||||
|
@ -104,6 +104,7 @@ units = [
|
||||
'sockets.target.wants/'],
|
||||
['systemd-udevd-kernel.socket', '',
|
||||
'sockets.target.wants/'],
|
||||
['time-set.target', ''],
|
||||
['time-sync.target', ''],
|
||||
['timers.target', ''],
|
||||
['tmp.mount', '',
|
||||
|
@ -14,9 +14,9 @@ ConditionCapability=CAP_SYS_TIME
|
||||
ConditionVirtualization=!container
|
||||
DefaultDependencies=no
|
||||
After=systemd-remount-fs.service systemd-sysusers.service
|
||||
Before=time-sync.target sysinit.target shutdown.target
|
||||
Before=time-set.target sysinit.target shutdown.target
|
||||
Conflicts=shutdown.target
|
||||
Wants=time-sync.target
|
||||
Wants=time-set.target time-sync.target
|
||||
|
||||
[Service]
|
||||
AmbientCapabilities=CAP_SYS_TIME
|
||||
|
@ -12,7 +12,7 @@ Description=Cleanup of Temporary Directories
|
||||
Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8)
|
||||
DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
After=local-fs.target time-sync.target
|
||||
After=local-fs.target time-set.target
|
||||
Before=shutdown.target
|
||||
|
||||
[Service]
|
||||
|
13
units/time-set.target
Normal file
13
units/time-set.target
Normal file
@ -0,0 +1,13 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1+
|
||||
#
|
||||
# This file is part of systemd.
|
||||
#
|
||||
# systemd is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
[Unit]
|
||||
Description=System Time Set
|
||||
Documentation=man:systemd.special(7)
|
||||
RefuseManualStart=yes
|
@ -11,3 +11,5 @@
|
||||
Description=System Time Synchronized
|
||||
Documentation=man:systemd.special(7)
|
||||
RefuseManualStart=yes
|
||||
After=time-set.target
|
||||
Wants=time-set.target
|
||||
|
Loading…
x
Reference in New Issue
Block a user