Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've checked configs and even installed ntp server, nothing seem to fix this,

sudo dpkg-reconfigure tzdata

Current default time zone: 'Asia/Tehran'
Local time is now:      Thu May  9 00:49:38 IRDT 2013.
Universal Time is now:  Wed May  8 20:19:38 UTC 2013.

/etc/ntp.conf

driftfile /var/lib/ntp/ntp.drift

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable


server ir.pool.ntp.org
server in.pool.ntp.org
server tr.pool.ntp.org

server ntp.ubuntu.com


restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

restrict 127.0.0.1
restrict ::1

Here are current situation

$ date
    Sun May 12 17:15:39 IRDT 2013
$ date --utc
    Sun May 12 12:45:40 UTC 2013
according to Google my local time is 
    11:45 AM Sunday, May 12, 2013 (IRDT)
share|improve this question
    
restarting ntp service give this log –  saeed144 May 12 '13 at 13:33
    
why does ntpdate gives this ntpdate 12 May 18:04:16 ntpdate[5864]: no servers can be used, exiting while I can dig internet ntp severs correctly. –  saeed144 May 12 '13 at 13:36

1 Answer 1

Force the initial synchronization using the -g flag in the NTP daemon. For Debian and derivatives, this is configured in /etc/default/ntp:

# cat /etc/default/ntp
NTPD_OPTS='-g'

Check the ntpd(8) manpage for a detailed explanation:


    -g Normally, ntpd exits with a message to the system log if the offset exceeds the panic threshold, 
which is 1000 s by default. This option allows the time to be set to any value without restriction;
however, this can happen only once. If the threshold is exceeded after that, ntpd will exit with a
message to the system log. This option can be used with the -q and -x options.

Check your logs to see if this is the case.

Use the ntpq(1) utility to check the remote servers:


# ntpq
ntpq> pe
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+213.194.159.3   81.19.96.148     3 u  798 1024  337   81.503    0.178  37.213
-mx.tjma.es      150.214.94.5     2 u  474 1024  375   54.353  -116.72  88.993
+m91-187-92-138. 78.46.108.116    3 u  830 1024  317   89.527   15.581  34.467
*www.clip.dia.fi 150.214.94.5     2 u  901 1024  377   45.648   -0.994  23.004
 LOCAL(0)        .LOCL.          10 l 207m   64    0    0.000    0.000   0.000
ntpq> as

ind assid status  conf reach auth condition  last_event cnt
===========================================================
  1 18026  9424   yes   yes  none candidate   reachable  2
  2 18027  931a   yes   yes  none   outlyer    sys_peer  1
  3 18028  9424   yes   yes  none candidate   reachable  2
  4 18029  961a   yes   yes  none  sys.peer    sys_peer  1
  5 18030  8043   yes    no  none    reject unreachable  4

One additional check would be comparing the system clock and the hardware clock to see if they are synchronized. Read the hwclock(8) for this.

share|improve this answer
    
it's already with -g option. –  saeed144 May 12 '13 at 13:19
    
what is strange is that ntpq> pe gives all delay offset jitter as 0.000. I've increased its log level, nothing important shown. –  saeed144 May 12 '13 at 13:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.