summarylogtreecommitdiffstats
path: root/ntpd-rs.service
blob: 2c170144f5ecbc43129ebcfece691633f6269a8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
[Unit]
Description=Network Time Service (ntpd-rs)
Documentation=https://github.com/pendulum-project/ntpd-rs
After=network-online.target
Wants=network-online.target
Conflicts=systemd-timesyncd.service ntpd.service chrony.service openntpd.service
ConditionCapability=CAP_SYS_TIME

[Service]
Type=simple
DynamicUser=yes
Restart=on-failure
RestartSec=2
ExecStartPre=/usr/bin/ntp-ctl --config /etc/ntpd-rs/ntp.toml validate
ExecStart=/usr/bin/ntp-daemon --config /etc/ntpd-rs/ntp.toml
Environment="RUST_LOG=info"
RuntimeDirectory=ntpd-rs
StateDirectory=ntpd-rs

CapabilityBoundingSet=CAP_SYS_TIME CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_SYS_TIME CAP_NET_BIND_SERVICE
NoNewPrivileges=yes
PrivateDevices=yes
ProtectHome=yes
LockPersonality=yes
MemoryDenyWriteExecute=yes
ProtectProc=invisible
ProtectControlGroups=yes
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
RestrictNamespaces=yes
RestrictSUIDSGID=yes

[Install]
WantedBy=multi-user.target