3

I wanted to test if ntp was working on my machine, so I set the time back 5 minutes and restarted ntp

$ sudo service ntp stop
$ sudo date -s "9:40 AM" # This time was 5 minutes ago
$ sudo service ntp start
$ ntpq -c lpeer # Check if sync to servers is working
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 hachi.paina.jp  .INIT.          16 u    -   64    0    0.000    0.000   0.000
 ts0.itsc.cuhk.e .INIT.          16 u    -   64    0    0.000    0.000   0.000
 ns.tx.primate.n .INIT.          16 u    -   64    0    0.000    0.000   0.000
 vpn.ipv4.cz     .INIT.          16 u    -   64    0    0.000    0.000   0.000
 europium.canoni .INIT.          16 u    -   64    0    0.000    0.000   0.000
$ date
Mon Sep 23 09:40:50 MDT 2013

It appears that the ntp service can connect to its ntp servers just fine, but the clock on my machine still isn't updated - even after waiting 5 more minutes.

How do I get ntp to actually update my system clock?

1 Answer 1

10
.INIT.          16 u

That's not fine. You either queried the state to soon, or your ntpd can't connect to those servers at all. When it is synced, it should display IP addresses or host names in the refid column, and values like 2 or 3 in the st column.

The output of a working ntpd should look like this:

iserv ~ # ntpq -p     
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*char-ntp-pool.c .shm0.           1 u  162 1024  377   33.332   -5.160   1.225
+node3.mneisen.o 192.53.103.108   2 u  145 1024  377   30.391   -0.756   1.122
+38.101.77.21    64.113.32.5      2 u 1673 1024  336  184.925   20.728  18.911
-ntp0.sanctioned 131.188.3.221    2 u  563 1024  377   30.445  -50.495  18.027
2
  • Haha, good to know. Having not seen valid results on that screen before, it would have been nice if ntp was a bit more explicit in saying that something was wrong. Commented Sep 23, 2013 at 22:02
  • Yeah, you're right. Try ntpdate -d 0.debian.pool.ntp.org, that should help you figure out if it's a firewall issue. Commented Sep 23, 2013 at 22:11

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.