chrisdaniel.net

  • About
  • Photos
  • I am currently looking for employment in the Portland area. See my resume in PDF, OpenDocument, or MS Word formats.

    Tuesday, June 03

    ntpd can’t deal with crappy clocks

    Filed under: Uncategorized ::
    Jun  3 11:11:45 ntpd[4292]: adjusting local clock by -0.163852s
    Jun  3 11:55:57 ntpd[4292]: adjusting local clock by -0.182279s
    Jun  3 13:02:25 ntpd[4292]: adjusting local clock by -0.184841s
    Jun  3 13:08:11 ntpd[4292]: adjusting local clock by -0.244856s
    Jun  3 18:08:11 ntpd[4293]: clock is now unsynced
    Jun  3 13:14:24 ntpd[4292]: adjusting local clock by -0.226083s

    If you’re seeing messages like the above in your logs, your clock might be drifting too much. Try turning off ntpd for a day, and just running ntpdate (or ntpd -q) every hour from a cron job. Check the log of the cron job output to see about how much your clock drifts per hour.

    Mine ended up being about a half second per hour, according to the adjustments ntpdate made. Apparently, ntpd couldn’t compensate for the drift; it seems like that much shouldn’t be a problem, but oh well. I’m currently running ntpdate in a cron job every hour to sync my time, and so far, everything seems to stay within a second of the real time, which is good enough for me. If you have the demand for better accuracy, get a clock that doesn’t suck.