您当前的位置: 首页 > 

mac OS X 从无法同步互联网时间想到的

发布时间:2014-01-13 20:01:36 ,浏览量:0

    最近在mac OS X 巨浪 :)上执行 

ntpdate time.nist.gov
    失败,提示 13 Jan 19:41:53 ntpdate[1374]: the NTP socket is in use, exiting

显然是端口被ntpd服务占用了,无法同步,用sudo root也不行。查看进程:

apple@kissAir: LaunchDaemons$ps aux|grep ntpd
root             1332   0.0  0.0  2469104   1464   ??  Ss    7:41下午   0:00.02 /usr/sbin/ntpd -c /private/etc/ntp-restrict.conf -n -g -p /var/run/ntpd.pid -f /var/db/ntp.drift
使用sudo killall ntpd强关无效,该服务立即restart,很顽强啊。

使用launchctl list 查看服务表,找到该服务,使用 sudo launchctl stop org.ntp.ntpd

无效,该服务依然自动重启。

遂使用sudo launchctl remove org.ntp.ntpd将其删掉,接下来ntpdate成功:

apple@kissAir: LaunchDaemons$sudo ntpdate time.nist.gov
13 Jan 19:36:54 ntpdate[1189]: adjust time server 216.171.120.36 offset 0.021011 sec
但是launchctl表里该服务没有了,所以得加上!使用mdfind查看ntpd位置,然后用load加上吧:
sudo launchctl load /System/Library/LaunchDaemons/org.ntp.ntpd.plist
然后重新start服务即可:
sudo launchctl start org.ntp.ntpd
大笑
关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    108252博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.2403s