13.0/13.1 ntpd differences
Hello :)
I'd like to get the 13.0 "synchronized to <time server>, stratum <stratum>" messages back on 13.1. On 13.0, running ntpd 4.2.4p8, reassuring messages appeared in /var/log/messages like "synchronized to 211.233.84.186, stratum 2". On 13.1, running ntpd 4.2.6p1, there are no messages in /var/log/messages to confirm that time is being synchronised. rc.ntpd on both starts ntpd with the same options. /etc/ntp.conf is identical on both, a "get it working and then make it secure" version: Code:
cat /etc/ntp.conf | grep -E -v '^$|^#' cat /etc/ntp.conf | grep -E -v '^$|^#' I would prefer to see that confirmation in /var/log/messages without having to run a command manually to check it. Can anyone advise how to get the old messages back? Best Charles |
well those messages shouldn't be as reassuring as you take them to be. Each time you get that message it means that it's gained trust in that ntp service, and so if it's the same address, it's also lost it's trust beforehand. You shouldn't see lots of them in the slightest. The way I recommend seeing ntp status is to run "ntpq -pn" and it'll print out the table of what it's doing nice and clearly. Things filling up logs files telling you not to worry is a crappy state of affairs. The best log is an empty log.
Your ntp.conf is pretty poor though, and needs changing. you have two servers listed there, that will only be resolved once on startup. what if one of them is wrong? How do you know which one of the two is wrong, it's just A vs B with no other informatin to do on. You want at least 3, preferably many more so you can really have confidence in your time sources. |
Well, it may not be in /var/log/messages but the way I do it is create a log in /tmp (that gets wiped out every time NTPD is started -- so the log doesn't get huge).
In /etc/rc.d/rc.ntpd you can make the "Start ntpd" section look like Code:
# Start ntpd: Hope this helps some. |
Thanks Chris :)
Useful to learn those messages indicate gaining a trust. Regards "so if it's the same address, it's also lost it's trust beforehand" it probably is a new address for reasons which relate to having only two server entries in the config file. Those entries are not to single servers but to server pools. As it says on ntp.org's NTP pool project page, "The pool.ntp.org project is a big virtual cluster of timeservers". As it says on their How do I use pool.ntp.org? page for best results only a single country pool should be used. In the case of India, the country pool is not adequate and it is necessary to extend to the continent. With that type of pool system, messages indicating that new trusts have been created are good -- they show that the pool is functioning as a pool and the local system is cycling around the pool members as intended. Regards "The best log is an empty log" there are pros and cons. Personally I prefer assurance/success messages having been bitten too many times by daemons etc. that were both not functional and not generating error messages. |
Thanks tronayne :) that's a neat idea but according to my understanding of the man page it would be the same messages as currently go to "the system log" -- presumably /var/log/messages -- so the gain would be in log management rather than in log content. Does your ntpd generate a lot of output?
|
Yes thanks, I know what an ntp pool is. The point is though that it is a collection of individual servers. you resolve that address you'll still only get one IP back, one server to check. If you think that you'd be getting a different server each time you polled, then clearly ntp would stand no chance at all, as the drift and delay would constantly change and ntp would never work. just use 0.in.pool.ntp.org, 1.in.pool.ntp.org, 2.in.pool.ntp.org etc... to pick 3 random servers instead of just one.
|
Quote:
Thing is, there just isn't anything in the system logs about NTPD and having this separate log (that's just NTPD) is handy if there's a problem -- and I haven't had any problems with it for a long, long time. Thing "just works." I've just stopped and restarted NTPD (network connection via wireless USB) and the entries look like this. Code:
cat /tmp/ntp.log Hope this helps some. |
Thanks Chris :)
Now I have a new problem because I respect your knowledge but my understanding of what you wrote is different from my understanding of the information on ntp.org's "How do I use pool.ntp.org?" page. Quote:
Quote:
Quote:
I understand that to be saying that best is to configure the country pool (as long as it is adequate), next best the continent pool and, as a last resort, the global pool. According to ntp.org, the appropriate configuration for users in India is Code:
server 2.in.pool.ntp.org LQ is great! Ask one question and get useful/necessary advice on another. A service model that few organisations attain :) |
Quote:
Quote:
Quote:
|
Quote:
Quote:
|
Thanks again Chris. This is turning out to be very educational :)
If I've understood correctly, the ideal scenario is where ntpd is configured to connect with at least 3 time servers and then maintains that connection (more properly "trust"?) with them long term. The randomising and hourly changing aspects of the ntp.org pools is simply to spread the load; it is not intended that an individual client should change. That is why the messages that I took as reassuring actually indicated that this ideal scenario had broken down; ntpd had lost contact with one of its ideally long-term time servers so had found another. |
Quote:
|
Quote:
|
Quote:
If 'ntpq -np' shows '*' (system peer) or '+' (candidate) in the first column, they are associations included in the algorithm. But '-' (outlyer), 'x' (falsetick), or ' ' (reject) means that they are discarded. The messages 'synchronized to...' refer to the system peer ('*') which changes every now and then. But '+' associations are also included in determining time. |
Quote:
Code:
root@CW9:/usr/share/doc/ntp-4.2.6p1# ls --classify Code:
pool in.pool.ntp.org Unnecessarily the peer was a stratum 1 server (if that's what the st column indicates). I understand it is bad NTP etiquette to peer with stratum 1 servers unless there is a real need for best accuracy. I tried adding tos floor 2 to ntp.conf (strange that the default value is 1 ?) but this resulted in only two time servers one of which was a tier 1 and disabled -- leaving ntpd with a single time server, a tier 4! Changing to tos floor 2 minclock 4 resulted in a tier 2 peer and 3 candidates. OK Changing to tos floor 2 minclock 3 to avoid loading the time server network unnecessarily, resulted in only two servers. The default minclock value is 3 (as documented on http://www.eecis.udel.edu/~mills/ntp...scopt.html#tos) so this last change was simply making the default explicit. Reverted to tos floor 2 minclock 4 |
All times are GMT -5. The time now is 09:58 AM. |