View previous topic :: View next topic |
Author |
Message |
Darthanubis Tux's lil' helper
Joined: 18 Oct 2002 Posts: 77
|
Posted: Thu Jan 09, 2003 10:08 pm Post subject: ntp-4.1.1b-r3 Broken? |
|
|
To: gentoo-user@gentoo.org
Subject: Re: [gentoo-user] ntpd configuration
Date: Thu, 09 Jan 2003 02:50:10 -0500
Organization: n/a
X-Mailer: Sylpheed version 0.8.8claws (GTK+ 1.2.10; i686-pc-linux-gnu)
On Wed, 08 Jan 2003 11:24:22 -0600
> If you use ntpd to update your time rather than ntpdate (which you
> should if you run a database ... avoids time discontinuity problems),
> then you still need /etc/ntp.conf.
>
> Your problem below is caused because you didn't read the contents of
> /etc/conf.d/ntpd as you should have
>
> # /etc/conf.d/ntpd
> NTPDATE_WARN="y"
> NTPDATE_CMD="ntpd"
> NTPDATE_OPTS=""
>
> # /etc/ntp.conf
> server timelord.uregina.ca
> server time.nist.gov
> logfile /var/log/ntpd.log
> driftfile /var/lib/misc/ntp.drift
>
> Then when you start ntp
> # /etc/init.d/ntpd start
>
> * Initializing clock via ntpd...
> [ ok ]
> * Starting ntpd...
> [ ok ]
>
Using this setup, the script starts fine. However the time does not get
updated. The log fills with :
9 Jan 02:31:09 ntpd[13177]: signal_no_reset: signal 17 had flags 4000000
9 Jan 02:31:09 ntpd[13178]: signal_no_reset: signal 17 had flags 4000000
9 Jan 02:31:11 ntpd[13178]: server returns a permission denied error
At then proceeds to fill the log with : server returns a permission
denied errors.
Ntpdate from CLI still updates the server. I don't know if this is a bug
or not, so I thought I'd run it past you guys first. Here is what my
confs look like:
/etc/conf.d/ntpd is the same as you have advised,
# Comment this out if you dont want the init script to warn
# about not having ntpdate setup
NTPDATE_WARN="y"
# Command to run to set the clock initially
# if you want to use ntpd to set the clock, change this to 'ntpd'
NTPDATE_CMD="ntpdate"
# Options to pass to the above command
# you might want to change 'someserver' to a valid
# hostname which you can aquire below
NTPDATE_OPTS="-b otc1.psu.edu"
##
# A list of available servers is available here:
# * http://www.eecis.udel.edu/~mills/ntp/clock1.html
# and
# * http://www.eecis.udel.edu/~mills/ntp/clock2.html
##
/etc/ntp.conf:
#restrict default noquery notrust nomodify
#restrict 127.0.0.1
#restrict 192.168.1.0 mask 255.255.255.0
#fudge 127.127.1.0 stratum 3
server otc1.psu.edu
server tock.usno.navy.mil
#server time.nist.gov
driftfile /var/lib/misc/ntp.drift
logfile /var/log/ntpd.log
Those original lines are commented out, as I have no idea what the hell
they mean.
Also /etc/init.d/ntpd stop does not stop all running ntpd processes?!
Before this "update" of ntp all was fine. Whats the deal? |
|
Back to top |
|
|
fidler Apprentice
Joined: 03 Jul 2002 Posts: 162 Location: Utah
|
Posted: Thu Jan 09, 2003 10:10 pm Post subject: |
|
|
I have the same problem with a similar configuration.... |
|
Back to top |
|
|
Darthanubis Tux's lil' helper
Joined: 18 Oct 2002 Posts: 77
|
Posted: Thu Jan 09, 2003 10:15 pm Post subject: |
|
|
I knew I could not be the only one. Thanks for confirming that!
Now how do we fix it? |
|
Back to top |
|
|
fidler Apprentice
Joined: 03 Jul 2002 Posts: 162 Location: Utah
|
Posted: Thu Jan 09, 2003 10:45 pm Post subject: |
|
|
Well, I changed my configuration back and it seems to work just fine....
/etc/conf.d/ntpd
Code: |
logfile /var/log/ntpd.log
driftfile /var/lib/misc/ntp.drift
# Name of the servers ntpd should sync with
# Please respect the access policy as stated by the responsible person.
#server ntp.example.tld iburst
##
# A list of available servers is available here:
# * http://www.eecis.udel.edu/~mills/ntp/clock1.html
# and
# * http://www.eecis.udel.edu/~mills/ntp/clock2.html
##
|
/etc/conf.d/ntpd
Code: |
root@pceurp52 conf.d # cat ntpd
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-x86/net-misc/ntp/files/ntpd.confd,v 1.8 2003/01/01 01:27:45 vapier Exp $
# Comment this out if you dont want the init script to warn
# about not having ntpdate setup
# NTPDATE_WARN="y"
# Command to run to set the clock initially
# if you want to use ntpd to set the clock, change this to 'ntpd'
NTPDATE_CMD="ntpdate"
# Options to pass to the above command
# you might want to change 'someserver' to a valid
# hostname which you can aquire below
NTPDATE_OPTS="-b some.time.server.org"
##
# A list of available servers is available here:
# * http://www.eecis.udel.edu/~mills/ntp/clock1.html
# and
# * http://www.eecis.udel.edu/~mills/ntp/clock2.html
##
|
While it may be true that one needs to use ntpd, ntpdate works just fine.
I did change my time server, however.... (for this post). |
|
Back to top |
|
|
Darthanubis Tux's lil' helper
Joined: 18 Oct 2002 Posts: 77
|
Posted: Thu Jan 09, 2003 11:21 pm Post subject: |
|
|
This is unacceptable as it does not fix the problem. Check your /var/log/ntp.log or ntpd.log to see what is actually happening. Is the time being updated on a regular basis ie. every hour? 9 Jan 02:43:11 ntpd[13178]:
server returns a permission denied error
9 Jan 02:43:11 ntpd[13178]: server returns a permission denied error
9 Jan 02:44:11 ntpd[13178]: server returns a permission denied error
9 Jan 02:44:11 ntpd[13178]: server returns a permission denied error
9 Jan 02:45:11 ntpd[13178]: server returns a permission denied error
9 Jan 02:45:11 ntpd[13178]: server returns a permission denied error
9 Jan 02:46:11 ntpd[13178]: server returns a permission denied error
9 Jan 02:46:11 ntpd[13178]: server returns a permission denied error
This is what I get trying to use ntpd.
9 Jan 16:09:45 ntpd[28125]: parent died before we finished, exiting
9 Jan 16:09:57 ntpd[28183]: signal_no_reset: signal 17 had flags 4000000
9 Jan 16:12:26 ntpd[28247]: signal_no_reset: signal 17 had flags 4000000
9 Jan 16:17:58 ntpd[28245]: kernel time discipline status change 41
This is what I get using ntpdate.
Finally,
20 Dec 19:43:26 ntpd[13149]: time reset 0.158601 s
20 Dec 19:43:26 ntpd[13149]: synchronisation lost
21 Dec 02:31:42 ntpd[13149]: time reset 0.660950 s
21 Dec 02:31:42 ntpd[13149]: synchronisation lost
21 Dec 03:08:12 ntpd[13149]: time reset -0.334943 s
21 Dec 03:08:12 ntpd[13149]: synchronisation lost
21 Dec 15:33:08 ntpd[13149]: synchronisation lost
21 Dec 15:51:20 ntpd[13149]: time reset 2.049580 s
21 Dec 15:51:20 ntpd[13149]: synchronisation lost
25 Dec 16:55:40 ntpd[13149]: synchronisation lost
25 Dec 17:13:50 ntpd[13149]: time reset 2.065477 s
25 Dec 17:13:50 ntpd[13149]: synchronisation lost
25 Dec 18:18:19 ntpd[13149]: time reset 0.667395 s
25 Dec 18:18:19 ntpd[13149]: synchronisation lost
25 Dec 18:46:31 ntpd[13149]: time reset -0.392610 s
25 Dec 18:46:31 ntpd[13149]: synchronisation lost
26 Dec 04:05:19 ntpd[13149]: time reset 0.654001 s
26 Dec 04:05:19 ntpd[13149]: synchronisation lost
26 Dec 04:39:53 ntpd[13149]: time reset -0.293852 s
This is what the log looked like when ntpd was working. Obviously something is wrong. |
|
Back to top |
|
|
SpanKY Developer
Joined: 18 Apr 2002 Posts: 321 Location: Somerville, MA
|
Posted: Fri Jan 10, 2003 2:43 am Post subject: Re: ntp-4.1.1b-r3 Broken? |
|
|
Quote: | 9 Jan 02:31:11 ntpd[13178]: server returns a permission denied error |
this is probably because you didnt read/understand the server information that was posted ... it probably only allows certain kind of clients to connect ... at any rate, its the server thats causing that ... find a better one
Quote: | Those original lines are commented out, as I have no idea what the hell they mean. |
ntpd added them for you
Quote: | Also /etc/init.d/ntpd stop does not stop all running ntpd processes?! |
ill look into this one
Quote: | Before this "update" of ntp all was fine. Whats the deal? |
many people complained about the state of ntpd ... they didnt want to run ntpdate on their machine, or they wanted to run a different program, etc...
this release (with the conf.d/ntpd file) allows people to do so |
|
Back to top |
|
|
Darthanubis Tux's lil' helper
Joined: 18 Oct 2002 Posts: 77
|
Posted: Fri Jan 10, 2003 2:57 am Post subject: Re: ntp-4.1.1b-r3 Broken? |
|
|
[quote="SpanKY"] Quote: | 9 Jan 02:31:11 ntpd[13178]: server returns a permission denied error |
this is probably because you didnt read/understand the server information that was posted ... it probably only allows certain kind of clients to connect ... at any rate, its the server thats causing that ... find a better one
Thanks for looking into this, as I and another have filed bug reports on this, as it is an ongoing thread on the gentoo user mailing list.
Also, it aint the server, its the same server I used for months. If it were that simple, I would naturally tried another server if I did not know anything else. I did not think I would have to mention that I tried several servers. |
|
Back to top |
|
|
SpanKY Developer
Joined: 18 Apr 2002 Posts: 321 Location: Somerville, MA
|
Posted: Fri Jan 10, 2003 3:01 am Post subject: Re: ntp-4.1.1b-r3 Broken? |
|
|
Quote: | Thanks for looking into this, as I and another have filed bug reports on this |
i know, i'm also known as vapier
Quote: | as it is an ongoing thread on the gentoo user mailing list. |
if only i received -user all the time
Quote: | Also, it aint the server, its the same server I used for months. If it were that simple, I would naturally tried another server if I did not know anything else. |
odd ... this would be a problem of all the ntpd releases since none of the revision changes has modified the compile process much |
|
Back to top |
|
|
SpanKY Developer
Joined: 18 Apr 2002 Posts: 321 Location: Somerville, MA
|
Posted: Fri Jan 10, 2003 3:20 am Post subject: Re: ntp-4.1.1b-r3 Broken? |
|
|
Quote: |
> # /etc/conf.d/ntpd
> NTPDATE_WARN="y"
> NTPDATE_CMD="ntpd"
> NTPDATE_OPTS=""
Also /etc/init.d/ntpd stop does not stop all running ntpd processes?! |
stop will only kill the 1 ntp process it starts ... it will not kill the one run by NTPDATE_CMD ... in this case you should have had -q in the NTPDATE_OPTS variable ...
if you can provide some info on how you got this to happen (aside from the above notes) then i can debug it some more ... |
|
Back to top |
|
|
Darthanubis Tux's lil' helper
Joined: 18 Oct 2002 Posts: 77
|
Posted: Fri Jan 10, 2003 4:51 am Post subject: |
|
|
To: gentoo-user List <gentoo-user@gentoo.org>
Subject: Re: [gentoo-user] ntpd configuration
Date: Thu, 09 Jan 2003 20:09:19 -0500
User-Agent: Mutt/1.4i
On Thu, Jan 09, 2003 at 05:48:16PM -0600, Thomas T. Veldhouse wrote:
> Oh yeah ---
<snip:description of ntpd woes>
Ah, I see the problem now. The ntpd rc script will start *both*
NTPDATE_COMMAND *and* ntpd, if you read the source. So you shouldn't
set NTPDATE_COMMAND to ntpd or else you'll start it twice.
--
T.T.
--
gentoo-user@gentoo.org mailing list
This is what another user determined. Thus ntpd cannot be used to update the time as one session of ntpd is using the port. SO it seems the script hhas to be told not to start ntpd? Because when I stop ntpd there is still one session of ntpd still running.
Checking my log, the time oddly seems to be syncing now! Albeit every 3hrs instead of every hour, but thats fine.
I changed nothing from the default. Here is what I have now.
/etc/ntpd.conf:
restrict default noquery notrust nomodify
restrict 127.0.0.1
restrict 192.168.1.0 mask 255.255.255.0
fudge 127.127.1.0 stratum 3
server otc1.psu.edu
server tock.usno.navy.mil
server time.nist.gov
#driftfile /var/lib/misc/ntp.drift
driftfile /etc/drift
logfile /var/log/ntp.log
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-x86/net-misc/ntp/files/ntpd.confd,v 1.8 2003/01/01 01:27:45 vapier Exp $
# Comment this out if you dont want the init script to warn
# about not having ntpdate setup
NTPDATE_WARN="y"
# Command to run to set the clock initially
# if you want to use ntpd to set the clock, change this to 'ntpd'
NTPDATE_CMD="ntpdate"
# Options to pass to the above command
# you might want to change 'someserver' to a valid
# hostname which you can aquire below
NTPDATE_OPTS="-b otc1.psu.edu"
##
# A list of available servers is available here:
# * http://www.eecis.udel.edu/~mills/ntp/clock1.html
# and
# * http://www.eecis.udel.edu/~mills/ntp/clock2.html
##
It appears to also work so long as I do not try to use a driftfile in location other than /etc/driftfile. Using driftfile /var/lib/misc/ntp.drift seems to stall the ntpd checking, as the log no longer writes any progress.
Once I used the above configuration, it updated properly every 3hrs. Thats fine, but can you confirm if this version needs the driftfile to be in /etc?
If so thats fine too I guess? |
|
Back to top |
|
|
fidler Apprentice
Joined: 03 Jul 2002 Posts: 162 Location: Utah
|
Posted: Fri Jan 10, 2003 4:23 pm Post subject: |
|
|
My /var/log/ntpd.log looks fine...
Code: |
9 Jan 15:39:49 ntpd[29127]: frequency initialized 0.000 from /var/lib/misc/ntp.drift
9 Jan 16:40:29 ntpd[29127]: ntpd exiting on signal 15
10 Jan 08:56:01 ntpd[1540]: frequency initialized 0.000 from /var/lib/misc/ntp.drift
|
Could you try a different server? |
|
Back to top |
|
|
Darthanubis Tux's lil' helper
Joined: 18 Oct 2002 Posts: 77
|
Posted: Fri Jan 10, 2003 4:48 pm Post subject: |
|
|
fidler wrote: | My /var/log/ntpd.log looks fine...
Code: |
9 Jan 15:39:49 ntpd[29127]: frequency initialized 0.000 from /var/lib/misc/ntp.drift
9 Jan 16:40:29 ntpd[29127]: ntpd exiting on signal 15
10 Jan 08:56:01 ntpd[1540]: frequency initialized 0.000 from /var/lib/misc/ntp.drift
|
Could you try a different server? |
Since your logfille and your driftfile are in the location as my old version of ntp which worked fine, I doubt we are speaking of the same version?
ntp-4.1.1b-r3 |
|
Back to top |
|
|
timmy n00b
Joined: 24 May 2002 Posts: 56 Location: Bath, UK
|
Posted: Sun Jan 12, 2003 12:13 pm Post subject: |
|
|
I'm also having problems with ntp 4.1.1b-r3.
My gateway PC is running gentoo 1.2 and has ntp 4.1.1a installed and successfully synching with my ISP's time server. I have 2 other PCs running gentoo 1.4_rc2 with 4.1.1b-r3. Before these 2 PCs were upgraded, they were also running ntp 4.1.1a and successfully synching with my gateway PC.
Now however, every time these PCs reboot, /etc/ntp.conf is reset to:
Code: | restrict default noquery notrust nomodify
restrict 127.0.0.1
restrict 192.168.0.0 mask 255.255.255.0
fudge 127.127.1.0 stratum 3
server 127.127.1.0
driftfile /etc/ntp.drift
logfile /var/log/ntp.log |
I have no idea where this is coming from... It works fine if I change it back to:
Code: | server 192.168.0.1
driftfile /etc/ntp.drift
logfile /var/log/ntp.log |
and restart ntpd.
I can stop and start ntp and ntp.conf stays correct, it gets set to the mad values on every reboot, though.
Tim |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20583
|
Posted: Sun Jan 12, 2003 2:56 pm Post subject: |
|
|
Moved from Other Things Gentoo. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
jaanv n00b
Joined: 16 Jul 2002 Posts: 12
|
Posted: Sun Jan 12, 2003 3:18 pm Post subject: ntp-4.1.1b-r3 Broken? |
|
|
Found out from the mailinglist that dhcpd rewrites ntp.conf - can be inhibited by passing -Y -N to dhcpcd_eth0 in /etc/conf.d/net.
jaanv |
|
Back to top |
|
|
SpanKY Developer
Joined: 18 Apr 2002 Posts: 321 Location: Somerville, MA
|
Posted: Sun Jan 12, 2003 10:25 pm Post subject: |
|
|
-r4 is out which should fix/help all the current problems |
|
Back to top |
|
|
Decibels Veteran
Joined: 16 Aug 2002 Posts: 1630 Location: U.S.A.
|
Posted: Sun Jan 26, 2003 7:43 pm Post subject: |
|
|
Well, I am trying to help someone that's time is always off and had the ntp.conf all setup and everything working until now. Great.
Figured out that the ntpdate was the best thing to use since it wasn't up all the time like a server. So removed ntp from /etc/init.d default and configured the /etc/conf.d/ntpd to use ntpdate and gave it several servers to use from the /etc/ntp.conf file that use to work fine. Seems to be working, set the clock back several hours and updated it fine.
Did notice that ntpd is started backup after boot, but at least it sets the time now instead of complaining. I guess it let's ntpdate do it's thing first. Thanks for the input.
By the way, I know two people that have -r4 and still have the problem. It didn't fix it. |
|
Back to top |
|
|
SpanKY Developer
Joined: 18 Apr 2002 Posts: 321 Location: Somerville, MA
|
Posted: Sun Jan 26, 2003 10:08 pm Post subject: |
|
|
i really dont see much here to work with ... you need to post more information as to what problems they are having |
|
Back to top |
|
|
Decibels Veteran
Joined: 16 Aug 2002 Posts: 1630 Location: U.S.A.
|
Posted: Mon Jan 27, 2003 3:30 am Post subject: |
|
|
I thought the problem was pretty well described above so I didn't mention it.
/etc/ntp.conf is overwritten each time apparently by dhcp. Written everytime reboot:
Code: | restrict default noquery notrust nomodify
restrict 127.0.0.1
restrict 24.207.208.0 mask 255.255.240.0
fudge 127.127.1.0 stratum 3
server 127.127.1.0
driftfile /etc/ntp.drift
logfile /var/log/ntp.log |
What I could find on the net about it seemed to indicate you needed to pass a -N option to dhcpcd to have it not overwrite the ntp.conf file. I didn't really find any info on exactly how to do that with Gentoo. I tried several ways and ended up not having eth0 starting. But for my needs I found that I really didn't need anything but ntpdate, since the computer isn't on all the time, time isn't mission critical for me.
The real bugger is that ntp worked fine for a long time, now it doesn't cause the file gets overwritten each time it boots. I did find one thing that said dhcp does this, saves the original as ntp.conf.sv, then when dhcp shuts down it puts the old .sv file back in place. Which seems kind of silly to replace it then put it back. What is even stranger is when did this start? I found out how to setup ntp on the net from a lot of sources (none of them mentioned passing an option to dhcp, so would seem like this is a new issue, but), then when this came up, found a few sources that indicated the -N option needed to be passed to dhcp. So get a little confusing about when and what is happening. At least I'm confused. hehe. Anyway, I found a pleasant enough workaround for my needs, that should not be affected by getting this fixed or not. Though I do believe it needs to have something done. |
|
Back to top |
|
|
SpanKY Developer
Joined: 18 Apr 2002 Posts: 321 Location: Somerville, MA
|
Posted: Mon Jan 27, 2003 3:40 am Post subject: |
|
|
Decibels wrote: | /etc/ntp.conf is overwritten each time apparently by dhcp. |
read the info in the ntp.conf file you get when you emerge ntp ... if you want, you can just read the cvs version here:
http://cvs.gentoo.org/cgi-bin/viewcvs.cgi/gentoo-x86/net-misc/ntp/files/ntp.conf?rev=1.4&content-type=text/vnd.viewcvs-markup
Quote: | What I could find on the net about it seemed to indicate you needed to pass a -N option to dhcpcd to have it not overwrite the ntp.conf file. I didn't really find any info on exactly how to do that with Gentoo. I tried several ways and ended up not having eth0 starting. |
read above
i believe that is the only problem you have ... |
|
Back to top |
|
|
Decibels Veteran
Joined: 16 Aug 2002 Posts: 1630 Location: U.S.A.
|
Posted: Mon Jan 27, 2003 3:59 am Post subject: |
|
|
Thanks, google didn't cough that one up to me.
I have always had that commented out, missed the options part in the
description.
#dhcpcd_eth0="..."
changed to
dhcpcd_eth0="-Y -N"
*Later: found out it had to be "-YN" and not as above, rebooted after putting ntpd back in default runscript and worked fine, file not overwritten and time set.
I will forward this to my Dad and see if it helps him. I am sure it will work, just don't have time till tomorrow to test it out myself.
Thanks again
Wrote a little tutorial on ntpd and ntpdate at:http://webpages.charter.net/decibelshelp/LinuxHelp_NTP.html#ntp |
|
Back to top |
|
|
DancesWithWords Guru
Joined: 29 Jun 2002 Posts: 347 Location: ottawa, canada
|
Posted: Thu Aug 21, 2003 9:18 pm Post subject: ntpd & ntpdate, |
|
|
Decibels,
Your mini-how-to was quite help full. Just got one question and that is pertaining to rebooting with a laptop, which is more common then with servers and desktops. I"ve heard that ntpdate can be used to get the correction time for the initial contact and the ntpd can be used after that to keep things accurate.
Have you heard of this and would you know how this would be configured? I understand that for this to work ntpdate must run before ntpd? If ntpdate runs the init.d first, does the script also terminate the program after the correct time had been received?
Thanks for you help.
--
DancesWithWords |
|
Back to top |
|
|
SpanKY Developer
Joined: 18 Apr 2002 Posts: 321 Location: Somerville, MA
|
Posted: Thu Aug 21, 2003 9:43 pm Post subject: |
|
|
you should update it for 4.1.2
things are very different but imo, a lot easier |
|
Back to top |
|
|
Decibels Veteran
Joined: 16 Aug 2002 Posts: 1630 Location: U.S.A.
|
Posted: Fri Aug 22, 2003 12:54 am Post subject: |
|
|
Hmmm, had to go to portage folder to find it. Update world not showing it as update candidate, but apparently not masked cause can install it without ~x86. Regenworld didn't change anything. Will look into it.
That did remind me that I needed to add another way to use ntpdate with /etc/local.start if your time is rarely off like mine. So did get that added. Thanks. |
|
Back to top |
|
|
Mnemia Guru
Joined: 17 May 2002 Posts: 476
|
Posted: Fri Aug 22, 2003 5:26 am Post subject: |
|
|
Prior to the 4.1.2 build, I had to comment out the entire /etc/conf.d/ntpd file as the settings in it were wrong if you use ntpd and not ntpdate. I commented it all to prevent the init script from starting ntpd twice.
What has changed in the new 4.1.2 version? Will that behavior be fixed now if I emerge it? I don't want to use ntpdate at all since my client machines are on all the time and ntpdate messes up (last time I checked) the measurement of the accuracy of your local clock. |
|
Back to top |
|
|
|