Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1310207
  • 博文数量: 416
  • 博客积分: 10495
  • 博客等级: 上将
  • 技术积分: 4258
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-23 22:13
文章分类

全部博文(416)

文章存档

2015年(7)

2014年(42)

2013年(35)

2012年(14)

2011年(17)

2010年(10)

2009年(18)

2008年(127)

2007年(72)

2006年(23)

2005年(51)

分类: 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 的 PID

ps -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 Description

I 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?
Is it too busy?

Configuration Info

Solution

The 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 running

ps -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.

Keywords

ntpdate socket already use
阅读(2719) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~