Linux ntpd sendto()错误的文件描述符错误和解决方案
时间:2020-01-09 10:37:18 来源:igfitidea点击:
问题:
我正在使用Red Hat Enterprise Linux服务器。
我在/var/log/message文件中收到以下错误:
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
如何解决以上错误?
回答:
如果在/var/log/messages中看到错误的文件描述符错误,请确保仅运行一个ntpd实例。
步骤1:停止ntpd
键入以下命令以停止ntpd:
# /etc/init.d/ntpd stop
步骤2:杀死ntpd
键入以下命令以杀死所有ntpd实例:
# killall ntpd
步骤3:启动ntpd
# /etc/init.d/ntpd start
步骤4:查看日志文件/var/log/messages
使用tail命令:
# tail -f /var/log/messages
输出:
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