Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
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.
Yes, I read that it (NTP) is one of the oldest protocols still in use, and apparently maintained by its 'inventor' still.
Anyhow, since my last post, I decided to go ahead and configure my ntp daemon. Luckily for me, others have taken this path before me, as the man pages are about the most vague I have seen to date, and most info on the net is based on them.
A search of LQ brought me To This Thread which is where I got much of the stuff with which I filled in the blanks in my ntp.conf file.
As of this moment, I think I am astep with the OP of that thread, if not ahead; when I finally got ntpd running correctly, it eventually told me that 11160 seconds was too big a jump, and to set the time manually. Well, 11160s is about 3 hours, which is precisely the amount that any one of my clocks is out-of-whack at any given time. So, I went to the BIOS and set the system clock to the CORRECT time UTC, and rebooted. I imagine the daemon is now running, but I have been posting this thread and haven't checked the log yet.
However, I would like to post the file.conf and log output, so that someone who knows what they're talking about can maybe tell me two or three things:
#1 - Is this output indicative of a properly functioning ntpd?
and
#2 - in the interest of not abusing the NTP server network, can anyone tell me what units of time are being used in the broadcastdelay setting in ntp.conf, and does this setting do what I think it does? The initial value in my file was 0.0008 but I have changed it to 10.0 . So, what does it mean, and what are the units? Further, how DO I tell it how often to check/sync the clock?
Here's my file right now, with most comments removed:
Code:
# Configuration file for ntpd.
#
logfile /var/log/ntp.log
logconfig all
# Canada pool servers
server 0.ca.pool.ntp.org
server 1.ca.pool.ntp.org
server 2.ca.pool.ntp.org
server 3.ca.pool.ntp.org
# server 127.127.1.0 # local clock
#
driftfile /etc/ntp/drift
# what does this stuff do?
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
# and what's this doing??
multicastclient # listen on default 224.0.1.1
# these don't work:
# listen eth0
# listen on lo
# what's this doing?
broadcastdelay 10.0
# I don't need keys do I?
#keys /etc/ntp/ntp.keys
#trustedkey 62889
#requestkey 12888
#controlkey 61421
# All the default 'restrict' stuff just caused everything to not work..
So, let's go look at the log, shall we?
Hmmm..
Code:
29 Sep 01:42:18 ntpd[2369]: logging to file /var/log/ntp.log
29 Sep 01:42:18 ntpd[2369]: precision = 1.000 usec
29 Sep 01:42:18 ntpd[2369]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
29 Sep 01:42:18 ntpd[2369]: Listening on interface wildcard, 0.0.0.0#123 Disabled
29 Sep 01:42:18 ntpd[2369]: Listening on interface lo, 127.0.0.1#123 Enabled
29 Sep 01:42:18 ntpd[2369]: Listening on interface eth0, 192.168.0.2#123 Enabled
29 Sep 01:42:18 ntpd[2369]: kernel time sync status 0040
29 Sep 01:42:18 ntpd[2369]: frequency initialized 0.000 PPM from /etc/ntp/drift
29 Sep 01:42:19 ntpd[2369]: frequency initialized 0.000 PPM from /etc/ntp/drift
29 Sep 01:42:19 ntpd[2369]: system event 'event_restart' (0x01) status 'sync_alarm, sync_unspec, 1 event, event_unspec' (0xc010)
29 Sep 01:42:20 ntpd[2369]: peer 216.138.202.177 event 'event_reach' (0x84) status 'unreach, conf, 1 event, event_reach' (0x8014)
29 Sep 01:42:21 ntpd[2369]: peer 192.139.46.42 event 'event_reach' (0x84) status 'unreach, conf, 1 event, event_reach' (0x8014)
29 Sep 01:42:22 ntpd[2369]: peer 192.135.48.21 event 'event_reach' (0x84) status 'unreach, conf, 1 event, event_reach' (0x8014)
29 Sep 01:42:23 ntpd[2369]: peer 192.75.104.241 event 'event_reach' (0x84) status 'unreach, conf, 1 event, event_reach' (0x8014)
29 Sep 01:46:42 ntpd[2369]: system event 'event_peer/strat_chg' (0x04) status 'sync_alarm, sync_ntp, 2 events, event_restart' (0xc621)
29 Sep 01:46:42 ntpd[2369]: synchronized to 192.139.46.42, stratum 2
29 Sep 01:47:56 ntpd[2369]: time reset +74.694801 s
29 Sep 01:47:56 ntpd[2369]: kernel time sync enabled 0001
29 Sep 01:47:56 ntpd[2369]: system event 'event_clock_reset' (0x05) status 'sync_alarm, sync_unspec, 3 events, event_peer/strat_chg' (0xc034)
29 Sep 01:48:09 ntpd[2369]: peer 192.75.104.241 event 'event_reach' (0x84) status 'unreach, conf, 2 events, event_reach' (0x8024)
29 Sep 01:48:12 ntpd[2369]: peer 192.135.48.21 event 'event_reach' (0x84) status 'unreach, conf, 2 events, event_reach' (0x8024)
29 Sep 01:48:45 ntpd[2369]: peer 216.138.202.177 event 'event_reach' (0x84) status 'unreach, conf, 2 events, event_reach' (0x8024)
29 Sep 01:48:49 ntpd[2369]: peer 192.139.46.42 event 'event_reach' (0x84) status 'unreach, conf, 2 events, event_reach' (0x8024)
29 Sep 01:52:29 ntpd[2369]: system event 'event_peer/strat_chg' (0x04) status 'sync_alarm, sync_ntp, 4 events, event_clock_reset' (0xc645)
29 Sep 01:52:29 ntpd[2369]: synchronized to 192.135.48.21, stratum 2
29 Sep 01:52:29 ntpd[2369]: system event 'event_sync_chg' (0x03) status 'leap_none, sync_ntp, 5 events, event_peer/strat_chg' (0x654)
29 Sep 01:52:29 ntpd[2369]: system event 'event_peer/strat_chg' (0x04) status 'leap_none, sync_ntp, 6 events, event_sync_chg' (0x663)
29 Sep 01:58:23 ntpd[2369]: synchronized to 192.139.46.42, stratum 2
29 Sep 02:15:39 ntpd[2369]: time reset +0.268735 s
29 Sep 02:15:39 ntpd[2369]: system event 'event_clock_reset' (0x05) status 'sync_alarm, sync_unspec, 8 events, event_peer/strat_chg' (0xc084)
29 Sep 02:15:39 ntpd[2369]: system event 'event_peer/strat_chg' (0x04) status 'sync_alarm, sync_unspec, 9 events, event_clock_reset' (0xc095)
29 Sep 02:16:15 ntpd[2369]: peer 216.138.202.177 event 'event_reach' (0x84) status 'unreach, conf, 3 events, event_reach' (0x8034)
29 Sep 02:16:19 ntpd[2369]: peer 192.139.46.42 event 'event_reach' (0x84) status 'unreach, conf, 3 events, event_reach' (0x8034)
29 Sep 02:16:36 ntpd[2369]: peer 192.75.104.241 event 'event_reach' (0x84) status 'unreach, conf, 3 events, event_reach' (0x8034)
29 Sep 02:16:42 ntpd[2369]: peer 192.135.48.21 event 'event_reach' (0x84) status 'unreach, conf, 3 events, event_reach' (0x8034)
29 Sep 02:20:34 ntpd[2369]: synchronized to 192.139.46.42, stratum 2
29 Sep 02:20:34 ntpd[2369]: system event 'event_sync_chg' (0x03) status 'leap_none, sync_ntp, 11 events, event_peer/strat_chg' (0x6b4)
29 Sep 02:20:34 ntpd[2369]: system event 'event_peer/strat_chg' (0x04) status 'leap_none, sync_ntp, 12 events, event_sync_chg' (0x6c3)
So, even I can tell that the time got synchronized.. But are those rather cryptic status messages normal, and OK??
And I can see that it synchronized a second time, to a different server, and checking the log again before posting this, I see it is syncing at weird intervals. It's working, but is it working right?
Well hey, my desktop clock is correct, despite that rotten 'Halifax' under it-- I'll locate that config file sometime, Raskin-- and I'll hafta wait till tomorrow to see when the crons run, but I suspect they'll be ontime. Meanwhile, feedback welcome!
PS - 'scuse my typing, my pet snake's sleeping in/on my left hand
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
Well, from documentation follows that you do not need broadcast delay - you use unicast NTP to server anyway. It is needed when one server sends data to multiple clients, and for some reason doesn't want to exchange with them one-by-one. For frequency add 'minpoll <k> maxpoll <l>' after each server; ntpd will poll this server no more frequent than 2^k seconds, but not less frequent than 2^l seconds. It should sync at weird intervals - they are random to reduce chances of worst-case scenarios for servers. I would check status messages with Wireshark - maybe unreach means packet loss, for example, sniffer will show everything. And what desktop environment are you using? I know that KDE doesn't display TZ. Neither does IceWM.
PPM error is probably 'pulses per minute' - frequency error that can be calculated from multiple time updates.
For the reocrd, I am using KDE, and it does display my timezone, but I shrunk the font so small that it now poses no problem.. I'd like to use a lesser WM, but to date I haven't gotten around to allocating the time it might take to get a lighter WM set up so I'd be happy with it.
I'll have to look into Wireshark-- I have no experience with it, and don't even know what it is.
The PPM info you suggest sounds good enough to be correct, so that works for me.
I will add the minpoll and maxpoll, and hope it accepts them. Where did you get those arguments from?
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
I went to www.ntp.org and read documentation there. That's probably the only place where you can be sure to get all options... Wireshark is just a program to show you all the network traffic on your computer. By the way, do you use plain or digital clock in KDE? I checked digital with no additional information checked in 'configure clock'->appearance.
I am using digital clock, with 'frame' and 'flashing dots'. I used analog clock until recently, and it was the same. I still have 'Halifax' under it, but no big deal.
I didn't realize, and didn't see, that ntp.org would have the ntpd configuration options. I'll read them.
Since I'm here, I did this in my config file:
Code:
# Canada pool servers:
#
server 0.ca.pool.ntp.org minpoll 14 maxpoll 12
server 1.ca.pool.ntp.org minpoll 14 maxpoll 12
server 2.ca.pool.ntp.org minpoll 14 maxpoll 12
server 3.ca.pool.ntp.org minpoll 14 maxpoll 12
Well, minpoll is greater than maxpoll, it can be expected to fail.
I initially took minpoll to mean 'minimum polling frequency' which would indeed be a larger number, and the opposite for maxpoll: a smaller number would mean 'more frequent polls'.
Seemed logical, in the absence of specific details, but.. It was the other way 'round. All fixed up now and thanks again *again* for the config editing tips -- I'll check into that too! EDIT -changing the clock*rc didn't work. Soon as I save it, the next time I open it it's back the way it was. Anyway, as I mentioned, the font is so small that it doesn't bother me any more.
Саша
Last edited by GrapefruiTgirl; 09-29-2007 at 07:51 AM.
I told that the measurement unit is second, as it is stated on ntp.org..
I'm not claiming otherwise, nor am I trying to be argumentative; yes, you did say it was 2^minpoll and 2^maxpoll SECONDS. The detail I was missing was which was which was the lesser of the two. I interpreted your first instruction such that I had them transposed. No big deal.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.