LinHES Forums
http://forums.linhes.org/

How to synchronize time?
http://forums.linhes.org/viewtopic.php?f=6&t=18255
Page 1 of 2

Author:  mkaz [ Sat May 03, 2008 5:30 am ]
Post subject:  How to synchronize time?

I am running r5f27 and the time on the mythbox is several minutes off. If I reboot, the time is set properly, but a little drift does occur apparently between reboots.

The wiki says that this version of KM automatically keeps the right, but how do I verify that? How do I have the time server program keep things correct? What do I look for? There is a process "ntpd" running after I rebooted.

Thanks!

Author:  ceenvee703 [ Sat May 03, 2008 6:40 am ]
Post subject: 

ntpd is supposed to maintain the correct time, but it seems that if your computer's time is considerably off from the correct time, it won't make that big a correction.

What I usually end up doing is turning off ntpd temporarily, run ntpdate to get it corrected, then turn ntpd back on.

Author:  mkaz [ Sat May 03, 2008 6:43 am ]
Post subject: 

Thanks for the reply, could you tell me the commands to do that? Then I could put them in crontab and run it daily...

Author:  mjl [ Sat May 03, 2008 7:17 am ]
Post subject: 

Hi,

i use as root, ntpdate -u pool.ntp.org at anytime. ntpd does not need to be stopped to run it. I add it to the bottom of /etc/init.d/bootmisc.sh so it starts out corrected a boot time.

There were some video card issues that would cause a time drift that ntpd can't keep up with. I forget the details but maybe a search can dig it up. Had to do with nvidia I think.

Mike

Author:  ceenvee703 [ Sat May 03, 2008 7:27 am ]
Post subject: 

Note that you may not have ntpdate depending on which KnoppMyth you're using. You may have to apt-get it.

Also, once it's synched, you shouldn't have to do this via cron. Once you're close, ntpd should keep things stable. It's only when you're way off does it seem to stop working.

Author:  mkaz [ Sat May 03, 2008 7:29 am ]
Post subject: 

Correct, ceenvee, I have no ntpdate, how do I get that as I am not that familiar with apt-get?

Author:  cecil [ Sat May 03, 2008 7:39 am ]
Post subject: 

Code:
apt-get update
apt-get install ntpdate

Author:  BluesBrian [ Sat May 03, 2008 7:39 am ]
Post subject: 

yes, as the wiki says, ntp is setup on r5f27. (This is not a definitive solution, but I hope that it helps!)

you can status it with
Code:
/etc/init.d/ntp status

your configuration file is /etc/ntp.conf

You could try running ntpdate .. I had to install it.. (run as root)
Code:
apt-get update
apt-get install ntpdate

Then run it with
Code:
ntpdate -u pool.ntp.org

That's configured in /etc/default/ntpdate

The wiki page suggest how you can periodically run it by addition to your crontab .. the example shows daily update.

There is some additional discussion on ntpdate (obsolete program) in
http://knoppmyth.net/phpBB2/viewtopic.php?t=14319&highlight=ntp

and you san search this forum for "ntp".

I like...
Greg Frost wrote:
Commands/services you might be interested in reading about:
date - if you just want to manually set the time
ntpdate - if you want to set it based on an ntp server
ntpd - if you want to keep your system in sync with an ntpserver
ntpq - if you mant to find out whats going on with ntpd

from
http://knoppmyth.net/phpBB2/viewtopic.php?t=8485&highlight=ntp

Primary reference:
http://www.knoppmythwiki.org/index.php?page=TimeSynchronizeHowTo
(maybe we'll get a "Time Lord" to update the wiki page for us! :D Yours is not a unique problem! )

Author:  ceenvee703 [ Sat May 03, 2008 7:49 am ]
Post subject: 

Thanks, I totally forgot about the "-u" option for ntpdate which doesn't require the ntp daemon turnoff/turnon. Old habits die hard.

I will try a cleanup on that time synch wiki page sometime soon.

Author:  mkaz [ Sat May 03, 2008 9:11 am ]
Post subject: 

I have it running in the crontab, and logging the results so I can review them.

Thanks!

Author:  thornsoft [ Wed May 07, 2008 5:54 pm ]
Post subject: 

mkaz wrote:
I have it running in the crontab, and logging the results so I can review them.

I've added mine too. I've had problems with drifting outside of the correction window, and then the time drifts by a couple minutes per day. So I added a call to ntpdate -u pool.ntp.org
It's in my crontab, set to run at 16:05. so it should bring things back in line before the nightly news (gets screwed up).

Author:  machine56 [ Wed Jun 11, 2008 8:44 am ]
Post subject:  ntp working again

I'm running R5F27 and my clock ended up being over 2 minutes fast. I downloaded ntpdate, ran it, and got "no servers found". Turns out I had to reset my Cisco 675 DSL modem. I'm using qwest in Boulder, CO. My access to the web was working the whole time, and I could ping the ntp servers. After the reset, ntpdate worked. Strange, but maybe this info might help someone. I'm at a loss for an explanation, but at least I can get ntp working again.

Author:  neutron68 [ Sat Oct 04, 2008 8:16 am ]
Post subject:  correction window??

ceenvee703 wrote:
ntpd is supposed to maintain the correct time, but it seems that if your computer's time is considerably off from the correct time, it won't make that big a correction.


Why doesn't the NTP client go fetch the correct time (once a day) from a public NTP server (such as time.nist.gov) and simply reset your clock - no matter how off it is? Then there would be no "correction window" weakness built into it.

Curious,
Eric

Author:  mjl [ Sat Oct 04, 2008 3:18 pm ]
Post subject: 

Hi
Quote:
i use as root, ntpdate -u pool.ntp.org at anytime. ntpd does not need to be stopped to run it. I add it to the bottom of /etc/init.d/bootmisc.sh so it starts out corrected a boot time.

There were some video card issues that would cause a time drift that ntpd can't keep up with. I forget the details but maybe a search can dig it up. Had to do with nvidia I think.


Also reread ceenvee703's quote.

You have control over the time servers to request the reference. It is in /etc/ntpd.conf and I set mine to be pool.ntp.org. That keeps it tight enough for this old farmer.

I have found the us.pool.ntp.org & north-america.pool.ntp.org sometimes misfire for me when I am on dialup so now simply use the pool.ntp.org and haven't looked back.

If you never reboot then the drift should automaticlly self adjust clock (slowly) to keep things very close over a period of days even with out a reference.

Your cmos clock is not corrected using ntpdate, so if you reboot guess what, your system starts out with, bad time and the ntpd can't usually fix it right away. I have been meaning to add the hwclock -w to my shutdown script just to fix that issue.

Mike

Author:  neutron68 [ Sun Oct 05, 2008 3:53 pm ]
Post subject:  ok, what IS in Knoppmyth by default?

I see several different ntp programs referenced in this thread. It is not 100% clear which ones do what and which ones are part of a default Knoppmyth installation, and which ones must be loaded manually!

I searched my R5F27 machine with "locate ntp' and found several files with that name in the title, including "/etc/ntp.conf". It looks like ntp IS present in a default install/upgrade.
So, what does this ntp do if it doesn't go out to an ntp server and set the system clock? All it does is tweak the clock by fractions of a second each day??

I searched my R5F27 machine with "locate ntpdate' and did NOT find any hits. It looks like ntpdate must be fetched and loaded manually, so that must not be present in a default install/upgrade.
From reading this thread, I get the impression that ntpdate IS the application we need to actually go out and fetch the time from ntp servers, correct? I always thought this function WAS in a default install/upgrade of Knoppmyth, but I guess is isn't!?

Eric

Page 1 of 2 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/