11

I'm having a problem with the clock drifting on my PC. I'M running

  • Ubuntu 10.10 on an somewhat crusty IBM e-server (1.5GB RAM, 2.4GHz CPU)

  • ntpd is running (started at run level 2)

  • servers are defined:

    server 1.us.pool.ntp.org
    server 2.us.pool.ntp.org
    server 3.us.pool.ntp.org
    server time.nrc.ca
    server ntp1.cmc.ec.gc.ca
    server ntp2.cmc.ec.gc.ca
    server wuarchive.wustl.edu
    server clock.psu.edu
    

Looking at the log file, it would seem that the ntp daemon is running, but the system clock never seems to be set, however.

If I manually set the time from a Casio "atomic" watch, the date/time displayed by the Clock applet drifts out of sync over time.

Looking at the log file (below) it would seem the ntp daemon started ok and is running.

So I am totally flummoxed right now :-(

Here's a copy of my ntp.log file.

1
  • Can you post your whole ntp.conf file? What do you get if you run the "ntpq" command and type "peers"?
    – BenTobin
    Feb 17, 2011 at 22:46

2 Answers 2

7

NTP daemons don't want to do a sudden massive jump in system time. For one, it borks the chronology of entries in your log files, system daemons might freak out, etc. What it does instead is "drift" your system clock into place. If you want to check how far off from "the actual time" you are you can query an ntp server:

ntpdate -q pool.ntp.org

NTP works by adjusting the length of a second on your system by a slight bit so that you slowly get the correct time. It can take a while for the drift to happen if your offset is high. What you can do though is force a hard sync once:

service ntp stop
ntpdate pool.ntp.org
service ntp start

Edit: in response to the comments below.

Set this line up in /etc/default/ntpdate

NTPDATE_USE_NTP_CONF=yes

5
  • I tried the ntpdate -q and got an interesting message 18 Feb 08:24:30 ntpdate[13940]: no server suitable for synchronization found. So now I'm wondering if there is something blocking my ability to sync the clock; corporate firewall rules perhaps?
    – droffo
    Feb 18, 2011 at 14:25
  • Hmm - I tried the same on my Asus eee 900 netbook (also with Ubuntu 10.10) and I get the same message while connected to the corp network. I'll try again later from a Starbucks or home and see if I get the same results.
    – droffo
    Feb 18, 2011 at 14:30
  • 2
    Correction. Should be: /etc/default/ntpdate
    – david6
    Jan 2, 2013 at 0:25
  • NTPDATE does not appear to honour the setting: NTPDATE_USE_NTP_CONF=yes in the config file (/etc/default/ntpdate).
    – david6
    Jan 2, 2013 at 2:30
  • @tim-bielawa That's very interesting, I hadn't thought of it that way. Could you point to a definitive resource where I could find out more about how NTPD corrects system time? Thanks in advance.
    – dexterous
    May 16, 2017 at 14:33
4

There have been some problems with NTP synchronisation in Ubuntu. Some fixes were identified and will be in the 11.04 release in April.

Colin Watson wrote a detailed blog post about this as a response to an Ubuntu Brainstorm post.

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .