我启动计算机并禁用互联网,发现系统日志中充满了有关 ntpd 的警告消息
ntpd[1123]: error resolving pool 0.ubuntu.pool.ntp.org: Temporary failure in name resolution (-3)
ntpd[1123]: error resolving pool 1.ubuntu.pool.ntp.org: Temporary failure in name resolution (-3)
ntpd[1123]: error resolving pool 2.ubuntu.pool.ntp.org: Temporary failure in name resolution (-3)
ntpd[1123]: error resolving pool 3.ubuntu.pool.ntp.org: Temporary failure in name resolution (-3)
ntpd[1123]: error resolving pool ntp.ubuntu.com: Temporary failure in name resolution (-3)
我如何在系统日志中禁用这些警告?
答案1
我尝试在 ntpd 配置文件(/etc/ntp.conf)中添加以下内容:
logconfig = -clockall -peerall -sysall -syncall
根据手册,它应该阻止所有日志记录,但我仍然看到系统日志中出现“错误解决”消息。
我设法停止消息的唯一方法是使用 -l 选项启动 ntpd,并将日志文件输出发送到 /dev/null:
ntpd -l /dev/null