]> git.ipfire.org Git - thirdparty/systemd.git/blob - units/systemd-timesyncd.service.in
test: make coverage runs happy with capsule@.service
[thirdparty/systemd.git] / units / systemd-timesyncd.service.in
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]
11 Description=Network Time Synchronization
12 Documentation=man:systemd-timesyncd.service(8)
13 ConditionCapability=CAP_SYS_TIME
14 ConditionVirtualization=!container
15 DefaultDependencies=no
16 After=systemd-sysusers.service
17 Before=time-set.target sysinit.target shutdown.target
18 Conflicts=shutdown.target
19 Wants=time-set.target
20
21 [Service]
22 AmbientCapabilities=CAP_SYS_TIME
23 BusName=org.freedesktop.timesync1
24 CapabilityBoundingSet=CAP_SYS_TIME
25 # Turn off DNSSEC validation for hostname look-ups, since those need the
26 # correct time to work, but we likely won't acquire that without NTP. Let's
27 # break this chicken-and-egg cycle here.
28 Environment=SYSTEMD_NSS_RESOLVE_VALIDATE=0
29 ExecStart=!!{{LIBEXECDIR}}/systemd-timesyncd
30 LockPersonality=yes
31 MemoryDenyWriteExecute=yes
32 NoNewPrivileges=yes
33 PrivateDevices=yes
34 PrivateTmp=yes
35 ProtectProc=invisible
36 ProtectControlGroups=yes
37 ProtectHome=yes
38 ProtectHostname=yes
39 ProtectKernelLogs=yes
40 ProtectKernelModules=yes
41 ProtectKernelTunables=yes
42 ProtectSystem=strict
43 Restart=always
44 RestartSec=0
45 RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
46 RestrictNamespaces=yes
47 RestrictRealtime=yes
48 RestrictSUIDSGID=yes
49 RuntimeDirectory=systemd/timesync
50 StateDirectory=systemd/timesync
51 SystemCallArchitectures=native
52 SystemCallErrorNumber=EPERM
53 SystemCallFilter=@system-service @clock
54 Type=notify
55 User=systemd-timesync
56 {{SERVICE_WATCHDOG}}
57
58 [Install]
59 WantedBy=sysinit.target
60 Alias=dbus-org.freedesktop.timesync1.service