当 PTP4L 无法连接到外部服务器时,它会失败

当 PTP4L 无法连接到外部服务器时,它会失败

我有一台 CentOS 7.8 服务器,它使用 PTP4L PTP 服务同步时钟。我希望该服务在无法与外部服务器同步时失败,因此我使用--gmCapable=0.不过,这似乎没有影响。当它无法到达外部时间服务器时,它只会使用本地时钟作为大师,给人一种一切正常的错误印象。我怎样才能防止这种情况发生?

# service ptp4l status
Redirecting to /bin/systemctl status ptp4l.service
● ptp4l.service - Precision Time Protocol (PTP) service
   Loaded: loaded (/usr/lib/systemd/system/ptp4l.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2020-05-12 15:38:33 CEST; 13s ago
 Main PID: 48280 (ptp4l)
   CGroup: /system.slice/ptp4l.service
           └─48280 /usr/sbin/ptp4l -f /etc/ptp4l.conf -i enp65s0f1 --gmCapable=0

May 12 15:38:33 eurex-tr5.veloquant.com systemd[1]: Started Precision Time Protocol (PTP) service.
May 12 15:38:33 eurex-tr5.veloquant.com ptp4l[48280]: [149997.679] selected /dev/ptp1 as PTP clock
May 12 15:38:33 eurex-tr5.veloquant.com ptp4l[48280]: [149997.681] port 1: INITIALIZING to LISTENING on INIT_COMPLETE
May 12 15:38:33 eurex-tr5.veloquant.com ptp4l[48280]: [149997.681] port 0: INITIALIZING to LISTENING on INIT_COMPLETE
May 12 15:38:40 eurex-tr5.veloquant.com ptp4l[48280]: [150004.734] port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
May 12 15:38:40 eurex-tr5.veloquant.com ptp4l[48280]: [150004.734] selected local clock 3cecef.fffe.015d03 as best master
May 12 15:38:40 eurex-tr5.veloquant.com ptp4l[48280]: [150004.734] assuming the grand master role

相关内容