SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
ntpdate will update the clock once when executed. ntp updates the clock at frequent intervals in small increments (except for the possibility at inital start up) so processes do not see a time jump and it also adjusts for system and hardware clock drift.
If you haven't modified /etc/ntp.conf and the execute bit is set for /etc/rc.ntpd then ntpd is simply syncing with the local hardware clock.
All PC hardware clocks drift and the drift cannot be detected without an external source to sync to.
I've modified my /etc/ntpd.conf like this (the ntpd docs recommend at least 3 external sources in the list from which ntpd picks):
Code:
#
# NTP server (list one or more) to synchronize with:
#server pool.ntp.org iburst
server 0.us.pool.ntp.org iburst
server 1.us.pool.ntp.org iburst
server 2.us.pool.ntp.org iburst
server 3.us.pool.ntp.org iburst
Then I set chmod +x /etc/rc.d/rc.ntpd and my time syncs automatically. You can use 'ntpq -p' to show which time server ntpd is synced to (shown with a '*'), but realize that it takes a few minutes for a time server to be chosen after every boot.
Well if the time on your box keeps lagging, you may want to try using the NTP daemon.
The configuration is in the /etc/ntp.conf file. You can try replacing the "server" line(s) with some NTP servers in Argentina for example (see http://www.pool.ntp.org/zone/ar):
Code:
server 1.ar.pool.ntp.org iburst
server 3.south-america.pool.ntp.org iburst
server 0.south-america.pool.ntp.org iburst
Then run:
Code:
chmod +x /etc/rc.d/rc.ntpd
sh /etc/rc.d/rc.ntpd start
You can use the "ntpq -pn" command to see the status of the NTP daemon. If you see an asterisk beside the IP address, that signifies that the time is "synced" with that server. It may take about 5 to 10 minutes before you see the time being "synched".
And don't bother trying to run the ntpdate command while the ntp daemon is running.
I was studing /etc/rc.d/rc.M, to know all the script that are run at boot time. When I saw the lines I quoted in post #1, I was surprised. Somebody in LQ had told me to run ntpdate, probably without knowing the precise circumstances.
Now I think I know what happens. The system clock lags on the one hand, and running, once in a while ntpdate did not cause an exit (post #6). It follows, I think, that the daemon is not updating the clock! But see how rc.M does find rc.ntpd. Then, rc.ntpd is to blame. I attached (post #1) a copy of it. Plus,
Basically when you have a server-client environment the NTP Daemon acts as a "time server" much like other known time-web servers.
MSN and several other major web hubs host time clock servers to allow PCs to keep their clocks updated. I think Microsoft may still operate time.microsoft.com which is one that I've used in the past because it's well known.
I was studing /etc/rc.d/rc.M, to know all the script that are run at boot time. When I saw the lines I quoted in post #1, I was surprised. Somebody in LQ had told me to run ntpdate, probably without knowing the precise circumstances.
Now I think I know what happens. The system clock lags on the one hand, and running, once in a while ntpdate did not cause an exit (post #6). It follows, I think, that the daemon is not updating the clock! But see how rc.M does find rc.ntpd. Then, rc.ntpd is to blame. I attached (post #1) a copy of it.
If you always have access to the internet on your box, then you probably should configure and run ntpd. The start script will do the initial "I don't care how off my clock is, make it be on time NOW!" clock adjustment and then do its best to keep the clock on the system match the rest of the world's view of "now".
If you have intermittent access to the internet, then you should simply run "ntpd -q -g -x" periodically (especially after you start up and have access to the internet). (ntpdate is deprecated.)
Code:
man ntpd
will tell you all sorts of interesting things. Pointing your browser at one of the html files in /usr/doc/ntp-4.2.6p3/html/ will also provide lots of good info. (Or whatever version of ntpd you've got.)
Although I use ntpd, out of curiosity I lookep up the "-x" option from the man page:
"-x
Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold. This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually. Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s. Thus, an adjustment as much as 600 s will take almost 14 days to complete. This option can be used with the -g and -q options. See the tinker command for other options. Note: The kernel time discipline is disabled with this option"
Frankly, I don't understand a bit!
What is "slew rate"?
What is the meaning of "..each second of adjustment requires an amortization interval of 2000 s..."?
Does all this means that if I "ntpd -g -q -x" It will tkae upto 14 days for the clock to be corrected?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.