我已经成功地为我的 arm box 交叉编译了 ntpd 4.2.6p5。我有制造商提供的自定义工具链。
Box 正在运行busybox + debian linux 的一些变体。
所以我没有安装 ntp 并进行了手动复制,为 ntpd 创建了一个 conf 文件并尝试运行它。
ntpd 在调试模式下总是返回这个: ~/ntp # ./ntpd -c ntp.conf -d
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,但这不是我的意图!
任何想法?
感谢你并致以真诚的问候!