Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Hi!
I have a problem in configuring ntp client. I want to synchronize with remote server in every second or minute. I configured ntp.conf but I didn't figure out how I can change the delay update. The ntpq -p shows the following, where the next update is after 10. Could you tell me the measure used. 10 what? And how I can adjust that?
Quote:
remote refid st t when poll reach delay offset jitter
==============================================================================
193.95.63.229 LOCAL(0) 3 u 10 64 1 20.273 -298125 0.001
when is defined as sec/min/hr since last received packet and is not adjustable. The poll time is adjustable with the min value being 64 and the max 1024 seconds. If the server in your post is the only one listed in your ntp.conf file your client will never sync to it since the offset is greater then 1000 seconds. Basically ntp will compensate for clock drift and once stabilized will automatically adjust the poll time.
As a side note what linux distribution/ version are you running?
In fact I have a time stamp project, so the time must be accurate and any manual change (By hacker for example) must be fixed rapidly. I can do that by ntpdate in cron and that permit a refresh on each minute or using ntp client.
However, ntp client doesn't work in the right manner. According to the last comment when is always less than poll which is not the case. In addition, when I change the time (date -s hh:mm:ss) with less than 1000 s difference, the adjustment did not happen in the next 64s.
I use ubuntu 10.10 and this is my ntp.conf file if needed:
Quote:
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntp/ntp.drift
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
# You do need to talk to an NTP server or two (or three).
#server ntp.ubuntu.com
server ntp.certification.tn
logfile /var/log/ntp.log
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.
# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust
# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255
#broadcast 127.0.0.1
#broadcastdelay 0.008
# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines. Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient
Correction I posted the default values. The polling range is from 16 seconds (4) and 1.5 days (7).
ntp does not necessarily perform a time jump. If the offset is <128ms it will set the correct time otherwise it will slew the clock frequency to speed up or slow down. When ntpd first starts it will set time to any value without restrictions once. Otherwise it will update time as posted.
Whereas ntpdate will set the clock once it does not provide for any drift compensation. If your application does not mind absolute time jumps then nptdate via cron might be the best choice.
To change the minpoll value add the following to the ntp.conf file.
minpoll 4 (2^x i.e. 16 seconds, values range from 4 to 10)
maxpoll 4
This will force ntp to always poll and 16 seconds. npt is not designed to update with a time jump except at initial start up. Curious why you expect someone or something to change time.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.