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.
In my past tries to fix the problem, I skipped the second step above. I do not say things are OK now. I have to keep an eye on it and see what happens. And of course, to thank you. Cheers.
In my experience, the one piece of documentation that you don't read will come back to bite you.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
Quote:
Originally Posted by stf92
My output to ntpq -pn is quite like yours. Now, I do not understand what happened just after 14.0 installation. All should have worked out of the box, I mean this problem should never have happened.
When you were installing Slackware 14.0, down toward the end of the setup, there's a section that offers choices of things to start at boot. One of those is NTP. Others include, oh, MySQL, Sendmail ...
The philosophy is that it's up to you to decide what you want running rather than jamming everything down your throat whether you want it or not; it's your system, your way.
Based on my experience with 12.0 and ntp, I'm almost sure I chose ntp. Somewhere I wrote down the default selections and the options such as I finally left them. I was about to pass these notes to some file, but I have not done it yet and the paper will have to wait till I find it. I like your "Oh".
OK. This is from /var/log/ntp.log (see attachment). The output speaks for itself. The daemon was running while logging (now it does not), it was started by someone, hence it's executable, and post #1 shows the configuration file. Any diagnostics possible?
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
Your /etc/ntp.conf looks fine -- one thing you might want to change, though, is add or edit this to allow multicasting (it's not absolutely necessary but may help):
Code:
multicastclient 224.0.1.1
Then you should see lines like this every so often in your log:
Code:
22 Jan 14:37:41 ntpd[2003]: Listen normally on 5 multicast 224.0.1.1 UDP 123
.
.
.
22 Jan 14:37:52 ntpd[2003]: Listen normally on 6 eth0 fe80::210:18ff:fe8a:82c1 UDP 123
Check your /etc/ntp/drift file; there should be a number in it, something like
Code:
cat /etc/npt/drift
-20.847
Yours, of course, will vary. If that file does not exist, you will need to create it with a zero in it (if it does exist, don't do this but do see what the value is, it's a text file, you can simply cat) it):
Code:
su -
cd /etc/ntp
cat > drift
0
Ctrl-D
Looking at your log entries, it does not appear that NTP ever synchronized. When it has synchronized, the output of ntpq -pn will look like
Code:
/usr/sbin/ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
127.127.1.0 .LOCL. 10 l 88 64 76 0.000 0.000 0.002
*72.8.140.200 64.147.116.229 2 u 7 64 77 1260.51 21.718 62.851
+173.255.224.22 129.6.15.29 2 u 7 64 77 1501.47 51.393 12.867
+199.7.177.206 64.147.116.229 2 u 5 64 77 1601.49 144.431 88.870
The asterisk and plus signs must appear or you're not synchronized. Before you do anything else, do this:
Code:
date
Is the result within a minute or so of the actual time? If so, do this
Code:
su -
# stop the server
/etc/rc.d/rc.ntpd stop
# start the server
/etc/rc.d/rc.ntpd start
# wait about five minutes and execute
/usr/sbin/ntpq -pn
# exit from su
If not, that usually means that the clock was too far off for NTP to sync it and the fix is
Code:
su -
# first, stop the server
/etc/rc.d/rc.ntpd stop
# use ntpdate to set the clock
ntpdate 3.ar.pool.ntp.org
# start the server
/etc/rc.d/rc.ntpd start
# wait about five minutes and exeucte
/usr/bin/ntpq -pn
Now, the use of ntpdate above is going to slew the clock to the correct time.
If your system was rebooted at some point (it looks as if it was given the log entry)
Code:
22 Jan 03:20:47 ntpd[1588]: ntpd exiting on signal 15
Were you really fiddling with it in the middle of the night? Wow.
Anyway, what happens when you shut the system down is that the system clock time is written to the hardware clock, which is kept running by a small battery on the motherboard. When the system is booted, that time is read from the hardware clock and the system clock is set to that time. The system clock is not an actual "clock;" it's timer executed by the kernel. The hardware clock is an actual clock chip (something like the ones in a wristwatch) that is kept running by the battery (system time is independent of the hardware clock after the system boots).
You've said that you were running Slackware 12? On the same hardware? It's quite possible that you've got a dead battery (Slackware 12 goes back a few years). If that's the case, the hardware clock isn't keeping time and, when the system boots, the system clock gets set to some who-knows-what time. You can tell if this is a problem by running date, write that down, reboot but enter the BIOS instead of letting the system boot.
Check the hardware clock time in the BIOS and compare the time to what the date utility showed you.
The multicastclient line is there. It takes 224.0.1.1 by default.
"Listen normally ..." does appear in the log.
/etc/npt/drift does exist.
The system clock does synchronize. I see in the log how it tracks the legal argentine time. And 'ntpq -pn' outputs the same as yours.
OS version is Slackware 14.0 and the machine, brand new, has a battery that is working. I can tell because BIOS keeps all of its values.
But the system panics by itself. I follow your procedure to start the daemon, I watch the log file and see all goes well, then suddenly, as you can see in the attachment,
LOCAL(0) MMMM NN unreachable.
A few more entries and then, it panics. That is, all this within a machine session, I mean, before turning off the machine. So, any battery problem is out of question. This is all i can say for now.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
Those LOCAL unreachable messages aren't an error -- they frequently appear in the log:
Code:
grep LOCAL ntp.log
20 Jan 04:40:02 ntpd[8160]: LOCAL(0) 8011 81 mobilize assoc 42537
20 Jan 04:40:13 ntpd[8160]: LOCAL(0) 8024 84 reachable
20 Jan 04:40:13 ntpd[8160]: LOCAL(0) 903a 8a sys_peer
20 Jan 04:53:01 ntpd[8160]: LOCAL(0) 8043 83 unreachable
20 Jan 17:27:26 ntpd[8160]: LOCAL(0) 8054 84 reachable
20 Jan 17:27:26 ntpd[8160]: LOCAL(0) 906a 8a sys_peer
20 Jan 17:47:42 ntpd[8160]: LOCAL(0) 8073 83 unreachable
22 Jan 14:37:41 ntpd[2003]: LOCAL(0) 8011 81 mobilize assoc 55212
22 Jan 14:37:49 ntpd[2003]: LOCAL(0) 8024 84 reachable
22 Jan 14:37:49 ntpd[2003]: LOCAL(0) 903a 8a sys_peer
22 Jan 14:50:38 ntpd[2003]: LOCAL(0) 8043 83 unreachable
22 Jan 14:57:36 ntpd[2003]: LOCAL(0) 8054 84 reachable
22 Jan 14:57:36 ntpd[2003]: LOCAL(0) 906a 8a sys_peer
22 Jan 15:10:24 ntpd[2003]: LOCAL(0) 8073 83 unreachable
23 Jan 06:55:37 ntpd[2002]: LOCAL(0) 8011 81 mobilize assoc 26179
23 Jan 06:55:49 ntpd[2002]: LOCAL(0) 8024 84 reachable
23 Jan 06:55:49 ntpd[2002]: LOCAL(0) 903a 8a sys_peer
23 Jan 07:10:45 ntpd[2002]: LOCAL(0) 8043 83 unreachable
Log entries when the system is rebooted (I did that earlier after installing the MySQL security update today) look like this (the first entry was the shutdown):
Code:
23 Jan 06:47:49 ntpd[2003]: ntpd exiting on signal 1
23 Jan 06:55:37 ntpd[2002]: Listen normally on 5 multicast 224.0.1.1 UDP 123
23 Jan 06:55:37 ntpd[2002]: Joined 224.0.1.1 socket to multicast group 224.0.1.1
23 Jan 06:55:37 ntpd[2002]: LOCAL(0) 8011 81 mobilize assoc 26179
23 Jan 06:55:41 ntpd[2002]: 50.116.38.157 8011 81 mobilize assoc 26180
23 Jan 06:55:43 ntpd[2002]: 72.8.140.200 8011 81 mobilize assoc 26181
23 Jan 06:55:49 ntpd[2002]: 199.7.177.206 8011 81 mobilize assoc 26182
23 Jan 06:55:49 ntpd[2002]: 0.0.0.0 c016 06 restart
23 Jan 06:55:49 ntpd[2002]: 0.0.0.0 c012 02 freq_set kernel -17.132 PPM
23 Jan 06:55:49 ntpd[2002]: LOCAL(0) 8024 84 reachable
23 Jan 06:55:49 ntpd[2002]: LOCAL(0) 903a 8a sys_peer
23 Jan 06:55:49 ntpd[2002]: 0.0.0.0 c515 05 clock_sync
23 Jan 06:55:50 ntpd[2002]: Listen normally on 6 eth0 fe80::210:18ff:fe8a:82c1 UDP 123
23 Jan 06:55:50 ntpd[2002]: peers refreshed
23 Jan 06:55:50 ntpd[2002]: new interface(s) found: waking up resolver
23 Jan 06:55:52 ntpd[2002]: 50.116.38.157 8024 84 reachable
23 Jan 06:55:52 ntpd[2002]: 72.8.140.200 8024 84 reachable
23 Jan 06:55:54 ntpd[2002]: 199.7.177.206 8024 84 reachable
23 Jan 07:02:26 ntpd[2002]: 50.116.38.157 903a 8a sys_peer
23 Jan 07:06:44 ntpd[2002]: 72.8.140.200 943a 8a sys_peer
23 Jan 07:10:45 ntpd[2002]: LOCAL(0) 8043 83 unreachable
23 Jan 07:24:09 ntpd[2002]: 199.7.177.206 943a 8a sys_peer
23 Jan 07:37:21 ntpd[2002]: 72.8.140.200 941a 8a sys_peer
You might take a look in /var/log/messages and see what that might tell you. Use an editor and jump to the end of the file then search backwards for "ntpd" -- that may give an indication of why the daemon is quitting.
The whole thing about the battery is, of course, moot (new hardware, should be a good battery one would think).
By the way, what's the value stored in /etc/ntp/drift?
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
OK, so what happens if you stop the daemon and let the clock free run for, say, 24 hours?
Just do
Code:
su -
/etc/rc.d/rc.nptd stop
Then every four hours or so use the dateand the hwclock utilities to see what time it is; write those down for later reference. Neither clock should not drift by much (couple or three minutes or so) over a 24-hour period. If either one does, it may require some "tuning" with the hwclock or adjtimex utilities (you probably want to read those manual pages). Let them free run for a day before attempting any adjustments.
Also, just a thought here, do your Ethernet connections go down at night?
And, those LOCAL(0) 8043 83 unreachable messages? Those appear when you're synchronized to the three external time sources you have defined. When you run /usr/sbin/ntpq -pn the LOCALHOST line is displayed without an asterisk or plus sign when the external timeservers are active, that's why the message.
So LOCAL(0) is the hardware clock, or some interrupt driven by the hardware clock (aka hardware timer).
Quote:
Originally Posted by tronayne
OK, so what happens if you stop the daemon and let the clock free run for, say, 24 hours?
Just do
Code:
su -
/etc/rc.d/rc.nptd stop
Then every four hours or so use the dateand the hwclock utilities to see what time it is; write those down for later reference. Neither clock should not drift by much (couple or three minutes or so) over a 24-hour period. If either one does, it may require some "tuning" with the hwclock or adjtimex utilities (you probably want to read those manual pages). Let them free run for a day before attempting any adjustments.
I'll do so.
Quote:
Also, just a thought here, do your Ethernet connections go down at night?
Definitely no. Maybe some small glitches in the line?
Local(0) is the fudge server defined in the ntp.conf and is the system clock. It is a used as fallback when the all other NTP servers (as defined in ntp.conf) or the network become unusable or unreachable. While NTP is running it will update the hardware clock periodically but it not used for anything else.
I had a very similar problem, all the same symptoms - server not starting, clock 1 hour out and nothing in the logs. The only difference was that it was intermittent. I power up my desktop every morning and the problem would occur once maybe twice a week. After a couple of months the problem disappeared as if by magic. The only thing I could think of was there was a faulty time server out there as I was using pool servers. Maybe commenting out the servers in your ntp.conf in turn may help to diagnose your fault.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
Keep in mind that NTP throws out "bad" time servers. It constantly evaluates the pool servers and will replace one or more if they're deemed unusable. If you have defined your pool servers as simply pool.ntp.org NTP will evaluate looking for those electrically close to you and will use the best one it can find.
It's a good idea to specify three (that's all out need) pool servers in /etc/ntp.conf like this:
Code:
# NTP server (list one or more) to synchronize with:
#server pool.ntp.org iburst
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
That first one, commented out, is the default; the others are specified including your country code (mine is the US, yours may be the UK or wherever. Defining them this way may lessen some problems. Too, the iburst directive can be left out (I do and you don't want every pool server defined with iburst you only want to use that if you have one time server defined, multiples don't help).
Make sure your locale is correct -- see what it is with locale:
The US goes on stupid time... uh, daylight time... much earlier than other countries an stays on daylight time longer than any other countries (that I know of anyway). The US went off daylight on 2 November. If you happen to be in the UK and your locale is US, well, there's your one hour off.
It's also a Good Idea to set your hardware clock to UTC and get it set to the correct time in the BIOS. You want to run timeconfig to get things in order.
On boot, your hardware clock is read to initialize the system (software) clock prior to when NTP starts. It typically takes about five minutes for NTP to synchronize to a "good" pool server, that's normal. It even takes about five minutes when you have one system severing time to others on your LAN (I have two data base servers that synchronize with my main work station which serves time to them and it still takes about five minutes for them to synchronize when they or the main server is rebooted for some reason or other).
You really do want the LOCL server specified. The comments at the top of /etc/ntp.conf tell you why:
Code:
# 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
If the network goes away, NTP synchronizes to itself until the network comes back which means that NTP will not shut itself down during network outages.
Once NTP is synchronized, where you get
Code:
/usr/sbin/ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
127.127.1.0 .LOCL. 10 l 50h 64 0 0.000 0.000 0.000
+67.18.92.145 199.249.223.123 2 u 699 1024 377 583.272 -30.872 80.343
+205.233.73.201 198.82.1.202 3 u 271 1024 377 639.571 -17.824 112.963
*4.53.160.75 64.113.32.5 2 u 568 1024 377 649.837 2.134 46.796
your system clock is synchronized (to the one with the asterisk). Note that LOCL is not doing anything, it's just sitting there waiting until it's needed.
On system shutdown, the system time is written to the hardware clock (keeping that up to date as it were). And the CMOS battery keeps that running while the power is off for the next boot initializing the system (software) clock.
It seems to me, I can't remember exactly what or why, that IPv6 should not be used (really for anything if I remember correctly). Can't prove that right now (I'll look it up though) but it just rings bells about not using IPv6.
[EDIT]
Forgot to mention that NTP will not synchronize if your time (either the hardware clock when booted or the software clock that has drifted before you start NTP) more than 1,000 seconds (roughly 16 minutes). If NTP does not synchronize, check your software clock and your hardware clock and set them close to real time before starting NTP. After it synchronizes, both clock will be set correclty.
[/EDIT]
Hope this helps some.
Last edited by tronayne; 11-14-2014 at 09:24 AM.
Reason: Forgot something
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.