Linux sync time error using ntpdate command __linux

Source: Internet
Author: User
Tags local time
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.