the NTP socket is in use, exiting,造成该原因是系统nt


今天在CentOS下测试时需要同步时间 使用的手动同步,出现the ntp socket is in use下为解决流程和方法!

ntpdate asia.pool.ntp.org

出现the NTP socket is in use, exiting错误。造成该原因是系统ntpd服务器正在运行中,可以通过ps aux | grep ntpd查看,如果还是要手动同步时间,就必须先停止该服务,命令为:

service ntpd stop

然后再通过ntpdate ntp.fudan.edu.cn即可手动同步时间了。另外注意,如果想把它加入到crontab中,最好把ntpdate命令的完整路径带上,即/usr/sbin/ntpdate ntp.fudan.edu.cn,否则可能在某些版本的Linux中不会被执行,同时用chkconfig把ntpd修改成不是自动运行的状态。

相关内容