ntpdate[1788]: The NTP socket is in use, exiting
Ntpdate 210.72.145.44
Feb 23:55:58 ntpdate[1788]: The NTP socket is in use, exiting
Run ntpdate in a cron job to set the local time approximately every hour. Most recently, I get the following error message every time I run this command.
Feb 23:55:58 ntpdate[1788]: The NTP socket is in use, exiting
What is using a Socket? Are you too busy? Configuration information Workaround
You receive this error message because XNTPD is already bound to the Socket. When you run Ntpdate, it broadcasts first, and then listens on port 123. If XNTPD is running and a process is already listening on the port, the ntpdate will not be able to run on it. Run the following command to find the XNTPD PID
Ps-ef|grep xntpd
unfortunately did not find the PID.
using lsof–i:123
[Root@10.10.10.74/data]$ lsof-i:123
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
NTPD 5003 NTP 16u IPv4 10940 UDP *:ntp
NTPD 5003 NTP 17u IPv6 10941 UDP *:ntp
NTPD 5003 NTP 18u IPv6 10942 UDP localhost6.localdomain6:ntp
NTPD 5003 NTP 19u IPv4 10943 UDP localhost:ntp
NTPD 5003 NTP 20u IPv4 10944 UDP 220.181.128.182:ntp
NTPD 5003 NTP 21u IPv4 10945 UDP localhost:ntp
[root@10.10.10.74/data]$ kill-9 5003
[Root@10.10.10.74/data]$ lsof-i:123
[root@10.10.10.74/data]$ ntpdate 210.72.145.44
Feb 00:09:44 ntpdate[4409]: Step time server 210.72.145.44 offset 355.689071 sec
Clear (Kill) the process, and then try synchronizing with the NTP server again. You should not receive this error message at this time.
Note that if the server you are trying to sync with is not running XNTPD, you receive the following error message:
ntpdate[12573]: No server suitable for synchronization found
This occurs because if you want to use the time of another server, the server must already be synchronizing itself.