我全新安装了 OpenNTP(openntpd 6.0p1-1)与此未注释的部分/etc/ntpd.conf:
servers 0.fr.pool.ntp.org
servers 1.fr.pool.ntp.org
servers 2.fr.pool.ntp.org
servers 3.fr.pool.ntp.org
当我检查配置时没问题但我没有办法让它工作:
$ sudo systemctl start openntpd.service
$ sudo systemctl status openntpd.service
● openntpd.service - OpenNTP Daemon
Loaded: loaded (/usr/lib/systemd/system/openntpd.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Fri 2016-08-05 23:54:43 CEST; 3s ago
Process: 13138 ExecStart=/usr/bin/ntpd -s (code=exited, status=0/SUCCESS)
Aug 05 23:54:43 looping systemd[1]: Starting OpenNTP Daemon...
Aug 05 23:54:43 looping ntpd[13138]: /var/db/ntpd.drift is empty
Aug 05 23:54:43 looping ntpd[13138]: dispatch_imsg in main: pipe closed
Aug 05 23:54:43 looping ntpd[13138]: Lost child: child exited
Aug 05 23:54:43 looping ntpd[13138]: Terminating
Aug 05 23:54:43 looping systemd[1]: Started OpenNTP Daemon.
$ sudo ntpd -sv
/var/db/ntpd.drift is empty
Lost child: child exited
Terminating
提前感谢任何提示。
根据BillThor的回答进行编辑:
$ sudo ntpd -dv
ntp: bad privsep dir /var/lib/ntp permissions: 40755
dispatch_imsg in main: pipe closed
dispatch_imsg in main: pipe closed
Lost child: child exited
Terminating
$ sudo chown -v root:root /var/lib/ntp
changed ownership of '/var/lib/ntp' from ntp:root to root:root
$ sudo ntpd -dv
ntp engine ready
答案1
尝试在漂移文件中输入一个数字,如 0.0。此文件应包含最后已知的漂移率。当 NTP 确定正确的漂移率时,它将被更新。
通常,通过从命令行运行守护进程可以更轻松地调试此类问题。应该有一个标志来请求守护进程不与终端分离。将此标志与调试标志结合使用应该可以提供有关正在发生的事情的更好信息。这些标志似乎是-d
和-v
。您可能还想尝试配置测试标志-n
。有关详细信息,请参阅手册页。