Linux ntpd sendto() Bad file descriptor error and solution

by on April 16, 2007 · 3 comments· LAST UPDATED December 14, 2007

in , ,

Q. I’m using Red hat Enterprise Linux server. I’m getting following error in /var/log/message file:

Apr 16 16:38:02 server ntpd[22694]: sendto(10.0.77.54): Bad file descriptor
Apr 16 16:38:08 server ntpd[22694]: sendto(66.111.46.200): Bad file descriptor
Apr 16 16:38:25 server ntpd[22694]: sendto(83.133.111.7): Bad file descriptor
Apr 16 16:38:28 server ntpd[22694]: sendto(81.169.156.100): Bad file descriptor

How do I fix above errors?

A. If you are seeing Bad file descriptor errors in /var/log/messages, make sure that only one instance of ntpd is running.

Step #1: Stop ntpd

Type the following command to stop ntpd:
# /etc/init.d/ntpd stop

Step #2: kill ntpd

Type the following command to kill all instance of ntpd:
# killall ntpd

Step #3: Start ntpd

# /etc/init.d/ntpd start

Step #4: Watch log file /var/log/messages

Use tail command:
# tail -f /var/log/messages
Output:

Apr 16 16:44:35 server ntpd[17549]: Listening on interface lo, 127.0.0.1#123
Apr 16 16:44:35 server ntpd[17549]: Listening on interface eth0, 10.5.123.2#123
Apr 16 16:44:35 server ntpd[17549]: Listening on interface eth1, 71.26.1.25#123
Apr 16 16:44:35 server ntpd[17549]: kernel time sync status 0040
Apr 16 16:44:36 server ntpd[17549]: frequency initialized -58.648 PPM from /var/lib/ntp/drift
Apr 16 16:47:52 server ntpd[17549]: synchronized to LOCAL(0), stratum 10
Apr 16 16:47:52 server ntpd[17549]: kernel time sync disabled 0041
Apr 16 16:47:52 server ntpd[17549]: synchronized to 71.26.2.221, stratum 1
Apr 16 16:50:00 server ntpd[17549]: synchronized to 10.0.77.54, stratum 
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 3 comments… read them below or add one }

1 simon September 15, 2009 at 1:20 pm

I want to know whether can I create 16 thread once ?and use them in some rules.

Reply

2 dacula January 20, 2010 at 12:48 pm

Should be:

/etc/init.d/ntp stop

and

/etc/init.d/ntp start

:)

Reply

3 Randy December 9, 2010 at 3:16 pm

Negative, that may be system dependent, but on every variant I have personally worked on it is ALWAYS “ntpd” not “ntp” since its a daemon. (Just like the apache webserver is httpd not http, and mysqld not mysql, etc etc)

P.S. thanks for the Answer, I had the same problem and it didn’t occur to me to look if a second process was running after I had done a “/sbin/service ntpd stop” :)

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: