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

Time is off and ntpdate command not found
http://forums.linhes.org/viewtopic.php?f=5&t=14319
Page 1 of 2

Author:  aphay [ Thu Feb 22, 2007 8:58 pm ]
Post subject:  Time is off and ntpdate command not found

I have upgraded to R5E50. I had to do a complete reinstall to get everything working. Now after a few weeks i have noticed that the time is off by about 2 min. I have tried using the ntpdate command to update the clock, but I keep getting "command not found". Is there another command that i am missing? Although not new to linux, I don't use it very much. This MythBox is my first real sojourn into linux. Any help is appriciated.

Author:  EvilTwin [ Fri Feb 23, 2007 8:27 am ]
Post subject: 

The ntpdate command is obsolete. To find it's replacement.

Become root and type:
ntp<tab>
This will show you command options.

Next type:
locate ntp<enter>
This will show you all the files or directories whose names include the string ntp in the filesystem.

Finally type:
man ntpd<enter>
Once you're reading the manual page type:
/ntpdate<enter>

Author:  aphay [ Fri Feb 23, 2007 9:09 pm ]
Post subject: 

Thanks for the reply EvilTwin! I tried

ntpd -q

and it did not update the time. I also tried adding the -g and -x options and still nothing. I also opened port 123 on the router to see if that was the problem and still nothing. Am i missing something?

Author:  mjl [ Sat Feb 24, 2007 11:07 am ]
Post subject: 

Hi,
Quote:
The ntpdate command is obsolete.
Well it may be old but I like it, it works and if it is missing from E50 then simply do (as root) an
# apt-get update
# apt-get install ntpdate
to get it back.
Once you have ntpdate
ntpdate -u <your time server> I use north-america.pool.ntp.org
# ntpdate -u north-america.pool.ntp.org

After the time is corrected then ntpd should take over and keep things on time :) As a matter of fact, I add that line to the bottom of my /etc/init.d/bootmisc.sh so the time is tweaked on a boot / reboot not that it happens very often.
Besure to also check your timezone table for the updated version. There have been some posts to help if needed. I forget if E50 has the new table for March 11.

Assuming this is a US post, or the information will require "adjustments" for a different area.

Mike

Author:  ceenvee703 [ Sat Feb 24, 2007 1:04 pm ]
Post subject: 

mjl wrote:
Well it may be old but I like it, it works ...


I like it too and ntpd -q didn't work for me either.

The only thing missing from your directions (I think) is that the ntp daemon has to be off before ntpdate will work.

If that's correct, while you're root and before running ntpdate you'd run /etc/init.d/ntp-server stop, then /etc/init.d/ntp-server start afterwards.

Author:  aphay [ Sat Feb 24, 2007 4:04 pm ]
Post subject: 

Thanks for the suggestions. I installed ntpdate and ran it. It said the NTP socket was in use, so i stopped the ntp server with /etc/init.d/ntp stop. Ran ntpdate lain.ziaspace.com. It corrected the time! Then started the NTP server back up /etc/init.d/ntp start. All is well for the moment.

The question is will it stay updated. I was planning to put a command in the cron jobs, but which one do i use? The ntpd or do i have to stop the ntp server every time and use ntpdate? What is the best method to solve this problem for good?

Author:  ceenvee703 [ Sat Feb 24, 2007 7:28 pm ]
Post subject: 

ntpd should keep things corrected as long as your clock drift is minor. No need to get cron involved. If it gets too far out of whack, ntpd can't correct it and you'll have to do what you did with ntpdate again.

You don't mention your hardware; if your motherboard is nForce2-based, it can be prone to clock drift so bad that ntpd can't fix things. There are things you can set via lilo that seems to fix things. Search for some of those keywords ("drift" "lilo" "nforce") and you should turn up the appropriate instructions.

Author:  mjl [ Sat Feb 24, 2007 8:13 pm ]
Post subject: 

Hi,
Quote:
I installed ntpdate and ran it. It said the NTP socket was in use
If you use the -u switch as posted, there should not have been an error. I think that tip came from our southern friend, nigelpearson

Mike

Author:  graysky [ Sun Feb 25, 2007 4:41 am ]
Post subject: 

aphay wrote:
I was planning to put a command in the cron jobs, but which one do i use?


I answered your question in a howto here.

Does it work for you?

Author:  mjl [ Sun Feb 25, 2007 7:14 am ]
Post subject: 

Hi,

Unless there is some kind of issue caused by a video card or some other abnormality, ntpd should keep you "on time". You may want to manually run the command (as root of course) just to see what the offset may be. Mine is usually with in .0xxx seconds so I know cron is doing it's job.

If the clock starts out only a few seconds off then ntpd can fix it quickly, however if the error is greater it may take days as it makes the corrections "gently"

I do mine once at boot and then ntpd does the rest.

Mike

Author:  aphay [ Sun Feb 25, 2007 1:41 pm ]
Post subject: 

So far it has not drifted. I will let it run for a week and then check to see if it is still on time. If it has drifted a little, i will set up the cron job that graysky posted. Thanks for everyones help!

Author:  aphay [ Fri Mar 09, 2007 7:49 pm ]
Post subject: 

It worked! ntpd has kept up on the time. Thanks All!

Author:  borgednow [ Tue Jun 05, 2007 7:47 pm ]
Post subject: 

EvilTwin wrote:
The ntpdate command is obsolete. To find it's replacement.

Become root and type:
ntp<tab>
This will show you command options.

Next type:
locate ntp<enter>
This will show you all the files or directories whose names include the string ntp in the filesystem.

Finally type:
man ntpd<enter>
Once you're reading the manual page type:
/ntpdate<enter>


I'm sorry, but this is confusing the heck out of me.

ntp<tab>? Tab isn't the same as <enter> for me. What's it supposed to do?

locate ntp<enter>
fine. I get a bunch of ntp files, but what am I looking for?

man ntpd<enter>
Ok. Is ntpd the same as ntp?

/ntpdate<enter>
I thought ntpdate was obsolete. It doesn't work for me as it's not on my machine. Why are you referring to ntpdate now?

In attempting to get the obsolete ntpdate before removing ntp:
Quote:
apt-get update


Sadly, this seems to no longer work. At least it didn't for me. My attempt to use this instruction came back with 404 errors on one of the packages, and it keeps getting stuck at 99% for the entire process.

Quote:

root@bigdog:/var/lib/ntp# apt-get update
Get:1 http://ftp.debian.org sid Release.gpg [189B]
Hit http://ftp.debian.org sid Release
Hit http://ftp.debian.org sid/main Packages/DiffIndex
Ign http://debian.geole.info sid Release.gpg
Hit http://ftp.debian.org sid/contrib Packages/DiffIndex
Hit http://ftp.debian.org sid/non-free Packages/DiffIndex
Get:2 http://ftp.debian.org sid/non-free Packages [96.9kB]
Get:3 http://ftp.debian.org sid/non-free Packages [96.9kB]
Ign http://debian.geole.info sid Release
Ign http://debian.geole.info sid/main Packages/DiffIndex
Ign http://debian.geole.info sid/contrib Packages/DiffIndex
Ign http://debian.geole.info sid/non-free Packages/DiffIndex
Ign http://debian.geole.info sid/main Packages
Ign http://debian.geole.info sid/contrib Packages
Ign http://debian.geole.info sid/non-free Packages
Err http://debian.geole.info sid/main Packages
404 Not Found
Err http://debian.geole.info sid/contrib Packages
404 Not Found
Err http://debian.geole.info sid/non-free Packages
404 Not Found
99% [3 Packages bzip2 0]


So I'm not sure what to do. Am I just confused? Or am I going to have to start manually setting the bios clock by hand?

Btw, my video card (not my mb) is nForce2 based. The drift is starting to get really bad, and it's been impacting mythtv quite a bit.

Author:  slowtolearn [ Tue Jun 05, 2007 8:32 pm ]
Post subject: 

borgednow wrote:
I'm sorry, but this is confusing the heck out of me.

ntp<tab>? Tab isn't the same as <enter> for me. What's it supposed to do?
<Tab> is the auto-completion keystroke. Try ls /etc/lirc/lircd<Tab>

borgednow wrote:
man ntpd<enter>
Ok. Is ntpd the same as ntp?
Nope

borgednow wrote:
/ntpdate<enter>
I thought ntpdate was obsolete. It doesn't work for me as it's not on my machine. Why are you referring to ntpdate now?
The forward slash (/) is the search mechanism within the man pages. I don't know why EvilTwin mentioned it there.

borgednow wrote:
In attempting to get the obsolete ntpdate before removing ntp:
Quote:
apt-get update


Sadly, this seems to no longer work. At least it didn't for me. My attempt to use this instruction came back with 404 errors on one of the packages, and it keeps getting stuck at 99% for the entire process.


Quote:

root@bigdog:/var/lib/ntp# apt-get update
Get:1 http://ftp.debian.org sid Release.gpg [189B]
Hit http://ftp.debian.org sid Release
Hit http://ftp.debian.org sid/main Packages/DiffIndex
Ign http://debian.geole.info sid Release.gpg
Hit http://ftp.debian.org sid/contrib Packages/DiffIndex
Hit http://ftp.debian.org sid/non-free Packages/DiffIndex
Get:2 http://ftp.debian.org sid/non-free Packages [96.9kB]
Get:3 http://ftp.debian.org sid/non-free Packages [96.9kB]
Ign http://debian.geole.info sid Release
Ign http://debian.geole.info sid/main Packages/DiffIndex
Ign http://debian.geole.info sid/contrib Packages/DiffIndex
Ign http://debian.geole.info sid/non-free Packages/DiffIndex
Ign http://debian.geole.info sid/main Packages
Ign http://debian.geole.info sid/contrib Packages
Ign http://debian.geole.info sid/non-free Packages
Err http://debian.geole.info sid/main Packages
404 Not Found
Err http://debian.geole.info sid/contrib Packages
404 Not Found
Err http://debian./color=red]geole.info[/color] sid/non-free Packages
404 Not Found
99% [3 Packages bzip2 0]
Comment out the geole entries. Also see http://www.knoppmythwiki.org/index.php? ... Repository
What version of KM are you using that includes Sid and geole entries?

borgednow wrote:
Btw, my video card (not my mb) is nForce2 based. The drift is starting to get really bad, and it's been impacting mythtv quite a bit.

I don't know if the GPU has the same effect, but have you seen http://www.knoppmythwiki.org/index.php? ... 2TimeDrift ? Some searching on these forums and the wiki will certainly point you in the right direction...

Author:  tjc [ Tue Jun 05, 2007 8:46 pm ]
Post subject: 

That looks like R5D1 or before.

A word to the wise, if you're doing a lot of work to keep an old version running it's time to upgrade. By sheer necessity on a project like this all of the support time and energy is going to be focused on current versions. Unless your old install is rock solid and trouble free, you'll end up pumping more effort into it and get far less support than you would with the current version where you'll have the developers and testers attention.

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