分类: LINUX
2008-04-22 11:01:50
ntpdate出现错误消息:ntpdate[3361]:the NTP socket is in use问题描述我正在一个 cron 作业中运行 ntpdate,以便大约每隔一小时就设置一次本地时间。最近,我每次运行该命令时都会收到下列错误消息。 ntpdate[3361]: the NTP socket is in use什么正在使用 Socket? 是不是太忙了? 配置信息解决方法您收到此错误消息的原因是由于 xntpd 已经绑定到了该 Socket。运行 ntpdate 时,它会首先进行广播,然后侦听端口 123。如果 xntpd 正在运行,而有一个进程已经在侦听该端口了,则会使 ntpdate 无法在上面运行。运行下列命令,即可找出 xntpd 的 PIDps -ef|grep xntpd 清除 (Kill) 该进程,然后尝试再次与 ntp 服务器进行同步。此时您不应该收到此错误消息。 请注意,如果您尝试与之同步的服务器没有运行 xntpd,则会收到下列错误消息: ntpdate[12573]: no server suitable for synchronization found 出现这种情况的原因是,如果您想使用另一个服务器的时间,该服务器必须已经进行了自身同步。 关键字ntpdate socket already use
.........The following is original English document.......
UOTHKBRC00008703 Problem DescriptionI run ntpdate in a cron job to set the local time every hour or so.Lately I have been getting the following error everytime I run it.ntpdate[3361]: the NTP socket is in use What is already using the socket? Configuration InfoSolutionThe reason you get this error is because xntpd is already bound to thatsocket. When ntpdate runs it broadcasts then listens on port 123. If xntpd is running, a process will already be listening on that port, hence ntpdate will not be able to run over it. Find the PID of xntpd by runningps -ef|grep xntpd Kill the process then try to sync to an ntp server again. You shouldn't get the error this time. Note that if you try to sync to a server that does not have xntpd running you will get the error: ntpdate[12573]: no server suitable for synchronization found The reason for this is that if you want to pull the time from another server, it must already be syncd to itself. Keywordsntpdate socket already use |