ffrr Posted August 2, 2006 Report Share Posted August 2, 2006 I have been running ntpd, and after booting up, the time is correct, but by the end of the day, it can be 10 minutes or more fast. I thought ntpd was supposed to regularly fix the time, and adjust it so it runs closer to actual. How often does it adjust the time, and can I control this? Maybe it's because of the uneven load I put on the machine, sometimes playing or converting video, but other times doing nothing? Would I be better off not usind ntpd and just scheduling ntpdate in a cron job every hour? (running Mandriva 2006 LE) Quote Link to comment Share on other sites More sharing options...
aioshin Posted August 3, 2006 Report Share Posted August 3, 2006 scheduling ntpdate via cron every hour or maybe every 30 min. is a good idea.. just make sure you got the correct ntp server pool Quote Link to comment Share on other sites More sharing options...
ffrr Posted August 3, 2006 Author Report Share Posted August 3, 2006 scheduling ntpdate via cron every hour or maybe every 30 min. is a good idea.. just make sure you got the correct ntp server pool It's just that I would have to turn the ntpd off, because with it running I get 3 Aug 10:51:12 ntpdate[13872]: the NTP socket is in use, exiting from ntpdate. Quote Link to comment Share on other sites More sharing options...
aioshin Posted August 3, 2006 Report Share Posted August 3, 2006 yeah, maybe you should turn that off, you only need it if you want it to serve as time server.. say you have other PCs on your network and you want their time to be sync on that BOX..or you want to join the NTP server pool.. but if not... then you may turn it off.. then let the ntpdate do the job Quote Link to comment Share on other sites More sharing options...
jboy Posted August 3, 2006 Report Share Posted August 3, 2006 Note that by default, ntpd log messages are written to /var/log/messages. To see what ntpd is doing and what adjustments are being made and when, execute the following command as the root user in a terminal: cat /var/log/messages | grep ntpd This may help you diagnose what's going on. Here's some sample output from mine: Aug 1 17:44:08 ntpdate[5308]: step time server 128.194.254.9 offset -6.097146 sec Aug 1 17:44:08 ntpd: succeeded Aug 1 17:44:08 ntpd[5322]: ntpd 4.2.0@1.1161-r Wed Sep 7 20:06:56 CEST 2005 (1) Aug 1 17:44:08 ntpd: ntpd startup succeeded Aug 1 17:44:08 ntpd[5322]: precision = 1.000 usec Aug 1 17:44:08 ntpd[5322]: kernel time sync status 0040 Aug 1 17:44:08 ntpd[5322]: frequency initialized -8.896 PPM from /etc/ntp/drift Aug 1 17:47:22 ntpd[5322]: synchronized to LOCAL(0), stratum=10 Aug 1 17:47:22 ntpd[5322]: kernel time sync disabled 0041 Aug 1 17:48:26 ntpd[5322]: kernel time sync enabled 0001 Aug 1 17:52:46 ntpd[5322]: synchronized to 128.194.254.9, stratum=2 Aug 1 18:10:07 ntpd[5322]: time reset -0.161913 s Aug 1 18:14:24 ntpd[5322]: synchronized to LOCAL(0), stratum=10 Aug 1 18:19:46 ntpd[5322]: synchronized to 128.194.254.9, stratum=2 Aug 1 18:40:16 ntpd[5322]: time reset -0.348388 s Aug 1 18:44:33 ntpd[5322]: synchronized to LOCAL(0), stratum=10 Aug 1 18:49:54 ntpd[5322]: synchronized to 128.194.254.9, stratum=2 Aug 1 19:04:56 ntpd[5322]: time reset +0.153221 s Aug 1 19:09:12 ntpd[5322]: synchronized to LOCAL(0), stratum=10 Aug 1 19:14:35 ntpd[5322]: synchronized to 128.194.254.9, stratum=2 Aug 1 19:28:41 ntpd[5322]: time reset +0.284179 s There's a great site for ntp documentation here: http://ntp.isc.org/bin/view/Main/DocumentationIndex Quote Link to comment Share on other sites More sharing options...
ffrr Posted August 3, 2006 Author Report Share Posted August 3, 2006 Note that by default, ntpd log messages are written to /var/log/messages. To see what ntpd is doing and what adjustments are being made and when, execute the following command as the root user in a terminal: cat /var/log/messages | grep ntpd This may help you diagnose what's going on. Here's some sample output from mine: There's a great site for ntp documentation here: http://ntp.isc.org/bin/view/Main/DocumentationIndex Yes I am not getting any time resets. See.. Aug 3 08:13:58 localhost ntpd: ntpd startup succeeded Aug 3 08:13:58 localhost ntpd[13439]: precision = 3.000 usec Aug 3 08:13:58 localhost ntpd[13439]: kernel time sync status 0040 Aug 3 08:13:58 localhost ntpd[13439]: frequency initialized -192.077 PPM from /etc/ntp/drift Aug 3 08:17:12 localhost ntpd[13439]: synchronized to LOCAL(0), stratum=10 Aug 3 08:17:12 localhost ntpd[13439]: kernel time sync disabled 0041 Aug 3 08:18:17 localhost ntpd[13439]: kernel time sync enabled 0001 Aug 3 11:02:52 localhost ntpd[13439]: ntpd exiting on signal 15 Aug 3 11:02:52 localhost ntpd: ntpd shutdown succeeded Nearly 3 hours between 08:18 and 11:02, with nothing happening Quote Link to comment Share on other sites More sharing options...
scarecrow Posted August 3, 2006 Report Share Posted August 3, 2006 Is the system Linux-only, or dualboot? If it also boots windows, then the time should be set to localtime, and not UTC. Quote Link to comment Share on other sites More sharing options...
ffrr Posted August 3, 2006 Author Report Share Posted August 3, 2006 Is the system Linux-only, or dualboot?If it also boots windows, then the time should be set to localtime, and not UTC. Not dual booot. Won't have Windows ever again :-) Seriously, the time is correct after booting up, but the clock gains time continually while it is running. As I posted above, the ntpd was not doing ANY corrections. I am currently running ntpdate every half hour in a cron job - at least that works. Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted August 3, 2006 Report Share Posted August 3, 2006 Try my recently made howto here: https://mandrivausers.org/index.php?showtopic=33672 it could be that your /etc/ntp.conf isn't configured correctly, which is why it's not synchronising. Quote Link to comment Share on other sites More sharing options...
ffrr Posted August 3, 2006 Author Report Share Posted August 3, 2006 Try my recently made howto here: https://mandrivausers.org/index.php?showtopic=33672 it could be that your /etc/ntp.conf isn't configured correctly, which is why it's not synchronising. I thought that too, but it looks OK. Here it is # # Undisciplined Local Clock. This is a fake driver intended for backup # and when no outside source of synchronized time is available. The # default stratum is usually 3, but in this case we elect to use stratum # 0. Since the server line does not have the prefer keyword, this driver # is never used for synchronization, unless no other other # synchronization source is available. In case the local host is # controlled by some external source, such as an external oscillator or # another protocol, the prefer keyword would cause the local host to # disregard all other synchronization sources, unless the kernel # modifications are in use and declare an unsynchronized condition. # server 127.127.1.0 # local clock fudge 127.127.1.0 stratum 10 server ntp.adelaide.edu.au #server pool.ntp.org #server pool.ntp.org #server pool.ntp.org # # Drift file. Put this in a directory which the daemon can write to. # No symbolic links allowed, either, since the daemon updates the file # by creating a temporary in the same directory and then rename()'ing # it to the file. # driftfile /etc/ntp/drift multicastclient # listen on default 224.0.1.1 broadcastdelay 0.008 # # Keys file. If you want to diddle your server at run time, make a # keys file (mode 600 for sure) and define the key number to be # used for making requests. # PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote # systems might be able to reset your clock at will. # #keys /etc/ntp/keys #trustedkey 65535 #requestkey 65535 #controlkey 65535 #restrict default ignore Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted August 3, 2006 Report Share Posted August 3, 2006 Looks fine yeah for the desktop-side. If you right-click the clock and choose adjust/date time and enter root password when prompted, does it show the adelaide mirror as well? Hopefully it does, that should confirm even more that it's set up correctly within KDE also. Quote Link to comment Share on other sites More sharing options...
ffrr Posted August 3, 2006 Author Report Share Posted August 3, 2006 (edited) Looks fine yeah for the desktop-side. If you right-click the clock and choose adjust/date time and enter root password when prompted, does it show the adelaide mirror as well? Hopefully it does, that should confirm even more that it's set up correctly within KDE also. It used to (that's where I set it in the first place), but as I said a bit earlier in the thread, I've turned off ntpd so I can use ntpdate in a cron job to keep the time straight. The problem has never been contacting and getting the time from a time server. It did this the first time I set it using KDE clock. I fact, even later, if I switched to a new time server, it would fix up the clock - but once only. It is the periodic fixes after that, that it never did. ntpd just sat there letting the time get out of whack from then on. Edited August 3, 2006 by ffrr Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted August 3, 2006 Report Share Posted August 3, 2006 Try adding this line to your config: restrict ntp.adelaide.edu.au mask 255.255.255.255 nomodify nopeer notrap just under the server ntp.adelaide line, and see if it helps make a difference. Alternatively, the line could be this: restrict ntp.adelaide.edu.au mask 255.255.255.255 nomodify notrap noquery if the first line doesn't work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.