1#  SPDX-License-Identifier: LGPL-2.1-or-later
2#
3#  This file is part of systemd.
4#
5#  systemd is free software; you can redistribute it and/or modify it
6#  under the terms of the GNU Lesser General Public License as published by
7#  the Free Software Foundation; either version 2.1 of the License, or
8#  (at your option) any later version.
9
10[Unit]
11Description=Wait Until Kernel Time Synchronized
12Documentation=man:systemd-time-wait-sync.service(8)
13
14# Note that this tool doesn't need CAP_SYS_TIME itself, but it's primary
15# usecase is to run in conjunction with a local NTP service such as
16# systemd-timesyncd.service, which is conditioned this way. There might be
17# niche usecases where running this service independently is desired, but let's
18# make this all "just work" for the general case, and leave it to local
19# modifications to make it work in the remaining cases.
20
21ConditionCapability=CAP_SYS_TIME
22ConditionVirtualization=!container
23
24DefaultDependencies=no
25Before=time-sync.target shutdown.target
26Wants=time-sync.target
27Conflicts=shutdown.target
28
29[Service]
30Type=oneshot
31ExecStart={{ROOTLIBEXECDIR}}/systemd-time-wait-sync
32TimeoutStartSec=infinity
33RemainAfterExit=yes
34
35[Install]
36WantedBy=sysinit.target
37