systemd-timesyncd 使用的默认 NTP 服务器是什么?

systemd-timesyncd 使用的默认 NTP 服务器是什么?

在我的 Linux 发行版中启用了该服务systemd-timesyncd。了解该服务的工作原理非常有用的是这篇文章回答

下面我报告有关此服务的一些系统信息:

  • 其单元文件为:/lib/systemd/system/systemd-timesyncd.service
  • 它的配置文件是/etc/systemd/timesyncd.conf

我没有改变默认文件timesyncd.conf,其内容如下所示:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See timesyncd.conf(5) for details.

[Time]
#NTP=
#FallbackNTP=time1.google.com time2.google.com time3.google.com time4.google.com
#RootDistanceMaxSec=5
#PollIntervalMinSec=32
#PollIntervalMaxSec=2048

文件中未设置timesyncd.conf该选项:NTP

#NTP=

尽管如此,该服务仍然能够设置系统日期,并且通过一些日志journalctl,我发现可以访问 NTP 服务器time1.google.com

time1.google.com使用的NTP 服务器(可能)在哪里设置systemd-timesyncd

谢谢

答案1

来自 timesyncd.conf 手册页。

CONFIGURATION DIRECTORIES AND PRECEDENCE
   The default configuration is defined during compilation, so a configuration file
   is only needed when it is necessary to deviate from those defaults. By default,
   the configuration file in /etc/systemd/ contains commented out entries showing the
   defaults as a guide to the administrator. This file can be edited to create local
   overrides.

相关内容