linuxptp/phc2sys.service
Miroslav Lichvar c4396f9c5c harden systemd services (RHEL-76760)
Resolves: RHEL-76760
2025-02-03 16:18:49 +01:00

37 lines
887 B
Desktop File

[Unit]
Description=Synchronize system clock or PTP hardware clock (PHC)
After=ntpdate.service ptp4l.service
[Service]
Type=simple
EnvironmentFile=-/etc/sysconfig/phc2sys
ExecStart=/usr/sbin/phc2sys $OPTIONS
CapabilityBoundingSet=CAP_SYS_TIME
DeviceAllow=char-pps rw
DeviceAllow=char-ptp rw
DevicePolicy=closed
LockPersonality=yes
MemoryDenyWriteExecute=yes
# This does not work with selinux
#NoNewPrivileges=yes
PrivateTmp=yes
ProtectControlGroups=yes
ProtectHome=yes
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectProc=invisible
ProtectSystem=strict
ReadWritePaths=/run
RestrictAddressFamilies=AF_UNIX
RestrictNamespaces=yes
RestrictSUIDSGID=yes
SystemCallArchitectures=native
SystemCallFilter=~@cpu-emulation @debug @module @mount @obsolete @raw-io
SystemCallFilter=~@reboot @resources @swap
[Install]
WantedBy=multi-user.target