How can I keep my system clock in sync under Mavericks?

I have a mid 2011 27" iMac running Mavericks (10.9.1). I updated from Mountain Lion this Fall when Mavericks was released. I never had any problem before with my system clock.

Since installing Mavericks my clock consistently gains about 20 seconds per day. I have my Time Zone correctly set and "Set Date and Time Automatically" is checked in my Date & Time system preferences. It is set to use "Apple/Americas/U.S. (time.apple.com)"

When I open the Date & Time System Preferences pane my clock gets adjusted immediately to the correct time, but without opening the pane, it gets off track pretty quickly.

I have rebooted, checked and unchecked the box to set the date and time automatically and neither seems to have helped.

Any solutions or ideas?


UPDATE:

I have made what feels like progress. Question: How can I tell if my mac is keeping the clock updated properly? and its accepted answer by grgarside provided a lot of helpful troubleshooting help. My drift is a whopping 499.988 (gains 43.19 seconds per day)!

Most importantly, pacemaker is running every 5 - 15 seconds, as evidenced by my stem log, however, every time it runs it gets an error:

Feb  1 11:53:29 jsw.local pacemaker[19928]: adjtime: Operation not permitted
Feb  1 11:53:39 jsw.local pacemaker[19928]: adjtime: Operation not permitted
Feb  1 11:53:51 jsw.local pacemaker[19928]: adjtime: Operation not permitted
Feb  1 11:53:59 jsw.local pacemaker[19928]: adjtime: Operation not permitted
Feb  1 11:54:09 jsw.local pacemaker[19928]: adjtime: Operation not permitted
Feb  1 11:54:19 jsw.local pacemaker[19928]: adjtime: Operation not permitted

It seems I have a permission problem, but I cannot figure it out. I have unloaded and reloaded the pacemaker plsit via launchctl

sudo launchctl unload /System/Library/LaunchDaemons/com.apple.pacemaker.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.pacemaker.plist

here is a text export of my com.apple.pacemaker.plist

{
    Label = "com.apple.pacemaker";
    ProgramArguments = (
        "/usr/libexec/pacemaker",
        "-b",
        "-e",
        "0.0001",
        "-a",
        10,
    );
    KeepAlive = {
        PathState = {
            "/private/var/db/ntp.drift" = YES;
        };
    };
}

my /private/var/db/ntp.drift file is owned by root:wheel and its permissions are 644, /System/Library/LaunchDaemons/com.apple.pacemaker.plist has exactly the same ownership and permissions.

I hope this update provides enough additional information so that someone can get me past this issue.


Solution 1:

these seem to work ok on my iMac, running Mountain Lion:

0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org time.apple.com

simply copy/paste the space-separated line above into the ’Set date and time automatically’ field, in Date & Time preferences. remember to press Enter after typing the ntp server names, so that ntp.conf gets updated.

Solution 2:

Maverisks' ntpd is broken, smashed, corrupt. Apple knows about this: I've spent hours on the phone to them, providing them samples and files galore. It may be a carry over from iOS ("Back to the Mac" whether or not it actually works). The culprit seems to be a new with Maverisks daemon called "pacemaker", which in classic Apple fashion is under documented and does not appear to behave in accordance with what little documentation there is.

Solution 3:

Before making a fresh install, I strongly suggest you to try resetting your NVRAM(non-volatile RAM).

A NVRAM(or PRAM on older, PowerPC-based Macs) stores certain settings. It's a kind of memory like the regular RAM in your Mac but with one major difference being that a NVRAM stores what's on it even if your Mac gets turned off.

Specifically, information stored in NVRAM / PRAM includes:

  • Speaker volume
  • Time-zone settings
  • Screen resolution
  • Startup disk selection
  • Recent kernel panic, if any

Probably, what's stored on your NVRAM about your time got corrupted somehow and now causes your issue.

Now, you might ask, what about the syncing of time with servers? What do I need that for? Well, it's just for setting your time instead of you doing it manually. Just a little gesture; nothing more. After it gets set then it's stored on your NVRAM as usual.

And your time gets corrected every time you open your Date & Time Preferences because probably opening there initiates a manual syncing of your time with the server. But after that things go haywire again.

Anyway, in order to reset your NVRAM:

  • Shut down your Mac.
  • Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
  • Turn on the computer.
  • Press and hold the Command-Option-P-R keys before the gray screen appears.
  • Hold the keys down until the computer restarts and you hear the startup sound for the second time.
  • Release the keys.

Source: Apple