天天看点

chronyd日志笔记

*:chrony-4.3 released(31 Aug 2022) --->Add selection option to log directive

chrony-4.1 released(13 May 2021 )-->Perform source selection immediately after loading dump files

chrony-4.0 released(7 Oct 2020)-->void replacing NTP sources with sources that have unreachable address

chrony-3.5.1 released(20 Aug 2020)-->When chronyd is configured to save the pidfile in a directory where the chrony user has write permissions (e.g. /var/run/chrony - the default since chrony-3.4), an attacker that compromised the chrony user account could create a symbolic link at the location of the pidfile to make chronyd starting with root privileges follow the symlink and write its process ID to a file for which the chrony user doesn’t have write permissions, causing a denial of service, or data loss.

chrony-3.4 released(19 Sep 2018)-->Change default pidfile to /var/run/chrony/chronyd.pid to allow chronyd without root privileges to remove it on exit

chrony-3.3 released(4 Apr 2018)-->Improve source selection with unreachable sources

1、在chrony.conf开启日志记录,会记录measurements.log statistics.log tracking.log三个日志文件。

# Specify directory for log files.
logdir /var/log/chrony
# Select which information is logged.
#log measurements statistics tracking      

2、tracking.log日志:SDFP1直接和持久百城GPS192.168.10.101同步,所以stratum是2,在10:34:20 estimated local offset(normally corrected by slewing the local clock)从(2.9us)2.953e-06改变到-3.245 e-01(320毫秒)增加了10的5次方十万倍,chrony认为出现了跳变,chronyc sources -v显示 'x' = time may be in error,在SMC上提示未同步unsynced。

Date (UTC) Time     IP Address   St   Freq ppm   Skew ppm     Offset L Co  Offset sd Rem. corr. Root delay Root disp. Max. error
===================================================================================================================================
2022-10-04 10:32:10 192.168.10.101   2     -8.932      0.046  2.743e-06 N  1  3.386e-06  2.199e-11  1.125e-04  1.618e-05  1.421e-04
2022-10-04 10:33:15 192.168.10.101   2     -8.926      0.039  2.953e-06 N  1  3.114e-06 -1.234e-06  1.096e-04  1.546e-05  1.435e-04
2022-10-04 10:34:20 192.168.10.101   2     -8.926      0.039  3.245e-01 N  1  2.341e-01 -4.651e-07  1.139e-04  1.207e-03  1.418e-04
2022-10-04 10:35:25 192.168.10.101   2     -8.926      0.039 -1.457e-01 N  1  2.290e-01 -2.415e-02  1.081e-04  5.415e-05  4.203e-01
2022-10-04 10:36:30 192.168.10.101   2     -8.926      0.039 -1.232e-01 N  1  1.714e-01  7.827e-02  1.143e-04  3.099e-04  1.530e-01      

3、tracking.log日志:SDFP2与SDFP1同步,所以stratum是3,在10:34:29-34秒 IP Address从192.168.5.50变成192.168.7.50;offset从-2.710e-07改变到 2.014e-01,增加了10的6次方、百万倍,跳跃状态Leap status:N表示正常,频繁出现?表示远程计算机当前未同步;number of combined sources组合源的数量也不稳定,正常应该为3。

Date (UTC) Time     IP Address   St   Freq ppm   Skew ppm     Offset L Co  Offset sd Rem. corr. Root delay Root disp. Max. error
===================================================================================================================================
2022-10-04 10:31:15 192.168.5.50     3    -11.877      0.065 -2.251e-06 N  3  4.257e-06  3.748e-10  1.618e-04  3.120e-05  1.983e-04
2022-10-04 10:32:20 192.168.5.50     3    -11.880      0.045 -1.611e-06 N  3  3.818e-06  1.453e-06  1.618e-04  3.686e-05  1.834e-04
2022-10-04 10:33:24 192.168.5.50     3    -11.879      0.038 -2.710e-07 N  3  4.314e-06  1.429e-06  1.685e-04  3.104e-05  1.883e-04
2022-10-04 10:34:29 0.0.0.0          0    -11.879      0.038  0.000e+00 ?  0  0.000e+00  1.254e-06  1.685e-04  9.808e-05  1.840e-04
2022-10-04 10:34:34 192.168.7.50     3    -11.879      0.038  2.014e-01 N  3  1.102e-01  1.214e-06  1.601e-04  2.196e-02  1.895e-04
2022-10-04 10:35:31 0.0.0.0          0    -11.879      0.038  0.000e+00 ?  0  0.000e+00 -3.294e-03  1.601e-04  6.595e-02  2.674e-01
2022-10-04 10:35:39 192.168.7.50     3    -11.879      0.038 -1.517e-02 N  3  2.942e-02  1.933e-07  1.592e-04  7.077e-03  7.555e-02
2022-10-04 10:36:36 0.0.0.0          0    -11.879      0.038  0.000e+00 ?  0  0.000e+00  1.057e-02  1.592e-04  4.618e-02  6.143e-02
2022-10-04 10:36:44 192.168.7.50     3    -11.879      0.038 -7.103e-02 N  1  4.620e-02  9.971e-03  1.674e-04  4.493e-03  6.194e-02
2022-10-04 10:37:41 192.168.6.50     3    -11.879      0.038 -9.663e-02 N  1  3.840e-02 -4.566e-07  1.879e-04  5.930e-03  9.512e-02      

继续阅读