|
| 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 using ntpsec |
| 12 | +Documentation=man:nts-timesyncd.service.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.ntstimesync1 |
| 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=!!/usr/bin/nts-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=nts-timesync |
| 50 | +StateDirectory=nts-timesync |
| 51 | +SystemCallArchitectures=native |
| 52 | +SystemCallErrorNumber=EPERM |
| 53 | +SystemCallFilter=@system-service @clock |
| 54 | +Type=notify |
| 55 | +User=nts-timesync |
| 56 | + |
| 57 | + |
| 58 | +[Install] |
| 59 | +WantedBy=sysinit.target |
| 60 | +Alias=dbus-org.freedesktop.ntstimesync1.service |
0 commit comments