JPelletier
Posts: 17
Joined: Fri Mar 13, 2015 1:34 pm

Wrong Date after reboot

Thu Jan 21, 2016 9:24 pm

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!

JPelletier
Posts: 17
Joined: Fri Mar 13, 2015 1:34 pm

Re: Wrong Date after reboot

Tue Jan 26, 2016 1:09 pm

Anyone? I really need help on this one please

MaxK1
Posts: 1043
Joined: Sun Aug 26, 2012 11:34 pm

Re: Wrong Date after reboot

Tue Jan 26, 2016 4:17 pm

Have you considered attaching an RTC?
You are in a maze of twisty little passages, all alike.
When General Failure and Major Disaster get together, Private Parts usually suffers.

User avatar
RaTTuS
Posts: 10381
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Wrong Date after reboot

Tue Jan 26, 2016 4:18 pm

what timezone are you in
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
DougieLawson
Posts: 35569
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Wrong Date after reboot

Tue Jan 26, 2016 5:36 pm

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]
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

JPelletier
Posts: 17
Joined: Fri Mar 13, 2015 1:34 pm

Re: Wrong Date after reboot

Tue Jan 26, 2016 6:00 pm

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).

Return to “Advanced users”