我已经成功地为我的手臂盒编译了ntpd 4.2.6p5。我有制造商提供的定制工具链。
Box正在运行busybox + debian的某些变体。
所以我没有安装ntp,做了一个手动拷贝,为ntpd创建了一个conf文件,并试图运行它。
当处于调试模式:~/ntp # ./ntpd -c ntp.conf -d时,ntpd总是返回此值。
ntpd 4.2.6p5@1.2349 Mon Apr 7 19:58:25 UTC 2014 (1)
9 Apr 07:39:44 ntpd[3592]: signal_no_reset: signal 13 had flags 4000000
9 Apr 07:39:44 ntpd[3592]: proto: precision = 91.000 usec event at 0 0.0.0.0 c01d 0d
kern kernel time sync enabled
Finished Parsing!!
9 Apr 07:39:44 ntpd[3592]: ntp_io: estimated max descriptors: 1024, initial socket
boundary: 16
9 Apr 07:39:44 ntpd[3592]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
9 Apr 07:39:44 ntpd[3592]: unable to bind to wildcard address :: - another process
may be running - EXITING在此之前,我还必须将/etc/services添加到
ntp 123/udp我的ntp.conf看起来像:
~/ntp # cat ntp.conf
server 193.2.4.6
server 193.2.4.2
driftfile ntp.drift所以我检查了netstat,在端口123上没有运行,没有ntpdate等等.
~/ntp # netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.3.1 0.0.0.0 UG 0 0 0 eth0
192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
~ # netstat -a | grep 123
~ #因此,它必须是与配置有关的东西,或者这个手臂盒没有配置什么.
噢,手动运行ntpdate是有效的:
~/ntp # ./ntpdate 193.2.4.6
9 Apr 07:49:16 ntpdate[3614]: step time server 193.2.4.6 offset -0.755704 sec
~/ntp #所以是的,我可以在cron中使用ntpdate,但这不是我的目的!
有什么想法吗?
谢谢,并致以最良好的问候!
发布于 2014-04-09 23:08:33
以下错误指示ntp在绑定到ipv6通配符时遇到问题:
9 Apr 07:39:44 ntpd[3592]: unable to bind to wildcard address :: - another process
may be running - EXITING我认为您的问题是ipv6,但是很难判断,因为您的诊断信息不是很好。您的netstat -a |grep 123命令是无用的,因为netstat将替代ntp来代替端口123。再试一次,用:
netstat -a -n | grep 123
按照这些思路,netstat -rn只与ipv4一起工作,然后用-6重试:
netstat -r -n -6
您的测试ntpdate使用了一个ipv4主机。您的服务器支持ipv6吗?你跑的时候会发生什么:
$ sntp -d -6 time.nist.gov我使用sntp是因为我不知道ntpdate是否有-6选项,而sntp是否有。
https://stackoverflow.com/questions/22953890
复制相似问题