Page 1 of 1

Wrong Date after reboot

Posted: Thu Jan 21, 2016 9:24 pm
by JPelletier
Hi,

I'm using htpdate instead of ntp for time synchronization because our provider block ntp port. I've uninstalled ntp and installed htpdate:

Code: Select all

sudo apt-get remove --purge ntp && sudo apt-get install htpdate
I've manually set the time to a good value and when I run the test command, it's all good:

Code: Select all

sudo htpdate -d -q  www.google.com wwww.nist.gov www.uic.edu
burst: 1 try: 1 when: 250000
www.google.com            21 Jan 2016 21:25:00 GMT (0.025) => 1
burst: 1 try: 2 when: 250000
www.google.com            21 Jan 2016 21:25:01 GMT (0.025) => 1
burst: 1 try: 1 when: 500000
wwww.nist.gov host or service unavailable
burst: 1 try: 1 when: 750000
www.uic.edu               21 Jan 2016 21:23:30 GMT (0.126) => -90
burst: 1 try: 2 when: 750000
www.uic.edu               21 Jan 2016 21:23:30 GMT (0.056) => -91
#: 2 mean: 0 average: 0.500
Timezone: GMT-5 (EST,EDT)
Offset 0.500 seconds


But, after every reboot, my time is offsetted by about 30 minutes in the future!

Thanks for help!

Re: Wrong Date after reboot

Posted: Tue Jan 26, 2016 1:09 pm
by JPelletier
Anyone? I really need help on this one please

Re: Wrong Date after reboot

Posted: Tue Jan 26, 2016 4:17 pm
by MaxK1
Have you considered attaching an RTC?

Re: Wrong Date after reboot

Posted: Tue Jan 26, 2016 4:18 pm
by RaTTuS
what timezone are you in

Re: Wrong Date after reboot

Posted: Tue Jan 26, 2016 5:36 pm
by DougieLawson
RaTTuS wrote:what timezone are you in
OP has told us he's in EST (GMT+5).

I've got a system running htpdate that's perfectly OK, but the webserver it get the time from is one that I control and has the clock sync'd to NTP.

Take a look at the headers for www.google.com www.nist.gov www.uic.edu [Note: take that extra W off the nist URL]

Code: Select all

[email protected] ~ $ wget --server-response http://www.uic.edu
--2016-01-26 17:36:24--  http://www.uic.edu/
Resolving www.uic.edu (www.uic.edu)... 128.248.155.15
Connecting to www.uic.edu (www.uic.edu)|128.248.155.15|:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Date: Tue, 26 Jan 2016 17:33:55 GMT
  Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips PHP/5.4.16 mod_wsgi/3.4 Python/2.7.5 mod_perl/2.0.9dev Perl/v5.16.3
  X-Powered-By: PHP/5.4.16
  Cache-Control: no-cache, max-age=300
  Vary: Accept-Encoding
  Expires: Tue, 26 Jan 2016 17:38:55 GMT
  Content-Type: text/html; charset=UTF-8
  X-Varnish-Cacheable: YES
  X-Varnish: 48466946 48276338
  Age: 149
  Via: 1.1 varnish-v4
  X-Varnish-Cache: HIT
  Accept-Ranges: bytes
  Connection: close
  Transfer-Encoding: chunked
Length: unspecified [text/html]
Saving to: ‘index.html’

index.html              [  <=>                 ]  96.04K   284KB/s   in 0.3s

2016-01-26 17:36:24 (284 KB/s) - ‘index.html’ saved [98350]

Re: Wrong Date after reboot

Posted: Tue Jan 26, 2016 6:00 pm
by JPelletier
My timezone is EST (GMT-5) and for the RTC it's not in the plan for now except if we really have to.

I'll take a look at the config file tomorrow to remove the extra W if it's really there (not a copy/paste error).