GearHack

: :

Add Comment | Related Links | TrackBack
Related Content

the NTP socket is in use

I'm trying to get my Mac OS X to automatically sync time with NTP. However, I keep getting an error message. Here is the command and the output:

  $ sudo ntpdate pool.ntp.org
5 Feb 12:38:04 ntpdate[314]: the NTP socket is in use, exiting

Anyone has an idea what is happening here? I use the same command on my Ubuntu computers and it works fine.

Chieh Cheng
Thu, 05 Feb 2009 20:42:43 +0000

OS X has built-in NTP synchronization, I guess it is conflicting with your command.

Go to System Preferences > Date and Time and there you can set up NTP.

atv
Thu, 05 Feb 2009 22:13:43 +0000

Why do you have to set it up this way? I thought if you have configured it in System Preferences, it should automatically sync up with whatever NTP server that you have specified?

I guess you can try the ntptimeset command.

The ntptimeset command reads your ntp.conf file to determine which NTP server to sync up with.

I believe this is how you run it:

ntptimeset -c -s

-s sets the system clock

Paul Y.
Thu, 05 Feb 2009 22:18:21 +0000

Thanks. Didn't realize "Set date & time automatically" in System Preferences is the same as NTP. I guess that answers why NTP client couldn't bind the socket.

I guess I've been using the UNIX shell too long . . . I still use "Terminal" 90% of the time on Mac OS X.

I couldn't find ntptimeset. I am using Mac OS X 10.5.4. Is that an utility on newer or order version of Mac OS X?

Chieh Cheng
Thu, 05 Feb 2009 22:28:50 +0000

I have 10.5.6. Apple must have removed it in Leopard.

Paul Y.
Thu, 05 Feb 2009 23:17:50 +0000

u'r using ntp so u can't run ntpdate, kill ntpd and retry ^^

dat
Tue, 23 Jun 2009 13:26:10 +0000

OS X uses ntpd instead of ntpdate. You can learn how OS X sets/adjusts time by looking at these Apple Developer pages:

http://developer.apple.com/mac/library/documentation/Darwin/ . . .
http://developer.apple.com/mac/library/documentation/Darwin/ . . .

In short, you can specify multiple NTP time-servers in your /etc/ntp.conf like this:

driftfile /var/lib/ntp/ntp.drift
server 0.north-america.pool.ntp.org
server 1.north-america.pool.ntp.org
server 2.north-america.pool.ntp.org
server 3.north-america.pool.ntp.org

On my Mac, the /var/lib/ntp/ntp.drift file didn't exist, so I created the "ntp" folder and then the file

mkdir /var/lib/ntp
touch /var/lib/ntp/ntp.drift

A reading of the above-listed Apple dev pages will give a bit of insight into my settings.

David Allie
Tue, 31 Aug 2010 14:10:45 +0000

Add Comment | Related Links | TrackBack
Related Content

Did your message disappear? Read the Forums FAQ.

Add Comment

Spam Control | * indicates required field
Your Name: *
E-mail:
Remember Me!
Comment: *
File attachment is optional. Please do not attach a file to your submission unless it is relevent.
Attach File:
(20 MB Max)
Spam Protection: * Sum of 9 + 9?
Click button only once, please!

TrackBack

Send Ping | TrackBack URL | Spam Control

No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here.

Messages, files, and images copyright by respective owners.


Articles | Wiki
Forums | Latest | RSS
Library | Links | News
Search | Store | Help

47 Users Online

Hacking Digital Cameras
Fun for Photographers


Amazon Associate

Copyright © 2004 - 2014. All Rights Reserved.