Author |
Message |
aphay
|
Posted: Thu Feb 22, 2007 8:58 pm |
|
Joined: Thu Jan 18, 2007 10:55 pm
Posts: 5
|
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.
|
|
Top |
|
|
EvilTwin
|
Posted: Fri Feb 23, 2007 8:27 am |
|
Joined: Tue Nov 08, 2005 7:31 am
Posts: 195
Location:
Secret Lair
|
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>
|
|
Top |
|
|
aphay
|
Posted: Fri Feb 23, 2007 9:09 pm |
|
Joined: Thu Jan 18, 2007 10:55 pm
Posts: 5
|
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?
|
|
Top |
|
|
mjl
|
Posted: Sat Feb 24, 2007 11:07 am |
|
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location:
Warwick, RI
|
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
|
|
Top |
|
|
ceenvee703
|
Posted: Sat Feb 24, 2007 1:04 pm |
|
Joined: Fri Apr 02, 2004 10:08 am
Posts: 1637
Location:
Virginia, USA
|
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.
|
|
Top |
|
|
aphay
|
Posted: Sat Feb 24, 2007 4:04 pm |
|
Joined: Thu Jan 18, 2007 10:55 pm
Posts: 5
|
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?
|
|
Top |
|
|
ceenvee703
|
Posted: Sat Feb 24, 2007 7:28 pm |
|
Joined: Fri Apr 02, 2004 10:08 am
Posts: 1637
Location:
Virginia, USA
|
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.
|
|
Top |
|
|
mjl
|
Posted: Sat Feb 24, 2007 8:13 pm |
|
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location:
Warwick, RI
|
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
|
|
Top |
|
|
graysky
|
Posted: Sun Feb 25, 2007 4:41 am |
|
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location:
/dev/null
|
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?
_________________ Retired KM user (R4 - R6.04); friend to LH users.
|
|
Top |
|
|
mjl
|
Posted: Sun Feb 25, 2007 7:14 am |
|
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location:
Warwick, RI
|
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
|
|
Top |
|
|
aphay
|
Posted: Sun Feb 25, 2007 1:41 pm |
|
Joined: Thu Jan 18, 2007 10:55 pm
Posts: 5
|
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!
|
|
Top |
|
|
aphay
|
Posted: Fri Mar 09, 2007 7:49 pm |
|
Joined: Thu Jan 18, 2007 10:55 pm
Posts: 5
|
It worked! ntpd has kept up on the time. Thanks All!
|
|
Top |
|
|
borgednow
|
Posted: Tue Jun 05, 2007 7:47 pm |
|
Joined: Wed Aug 23, 2006 3:07 pm
Posts: 339
|
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.
|
|
Top |
|
|
slowtolearn
|
Posted: Tue Jun 05, 2007 8:32 pm |
|
Joined: Wed Nov 16, 2005 8:55 pm
Posts: 1381
Location:
Farmington, MI USA
|
|
Top |
|
|
tjc
|
Posted: Tue Jun 05, 2007 8:46 pm |
|
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location:
Arlington, MA
|
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.
|
|
Top |
|
|