View previous topic :: View next topic |
Author |
Message |
elwood75 n00b
Joined: 24 Sep 2003 Posts: 7
|
Posted: Sat Jul 17, 2004 5:33 pm Post subject: ntp.conf being overwritten by dhcpc |
|
|
On three gentoo boxes I followed this guide, and within days my ntp.conf file had been overwritten-- very frustrating!
However I found that others on the web were having the same issue, and the ntp mailing lists indicated the answer. If you DHCP server thinks it has info about the ntp servers for your network, the DHCP client will overwrite your ntp.conf configuration with the configuration provided by the DHCP server.
To avoid this, uncomment dhcpcd_eth0 (or whichever network adapter is appropriate) , and add "-N" to the config line:
Code: | # For DHCP set iface_eth? to "dhcp"
# For passing options to dhcpcd use dhcpcd_eth?
#
iface_eth0="dhcp"
dhcpcd_eth0="-t 30 -N"
|
This tells the DHCP client to not overwrite the ntp.conf file.
Brad |
|
Back to top |
|
|
Martz n00b
Joined: 04 Mar 2004 Posts: 72
|
Posted: Wed Jul 21, 2004 11:16 am Post subject: |
|
|
I'm having a small problem with getting the time to syncronise. It seems that my clock has drifted too far for NTPd to update it
I have set the system time (through webmin, im a n00b) to be that of GMT as found on Worldtimeserver so my system clock roughly matches
I have also checked that I have my time zone set correctly, and symlinked to GMT:
jupiter# ln -sf /usr/share/zoneinfo/GMT /etc/localtime
When I run ntpq -p it shows a very large offset:
Code: |
remote refid st t when poll reach delay offset jitter
==============================================================================
193.25.198.254 145.238.110.49 2 u 3 64 1 24.808 -354394 0.001
bear.zoo.bt.co. 193.63.106.104 2 u 2 64 1 28.690 -354394 0.001
|
I get this in my ntpd.log file:
Code: |
21 Jul 12:11:09 ntpd[6603]: synchronized to 193.25.198.254, stratum=2
21 Jul 12:11:09 ntpd[6603]: time correction of -3544 seconds exceeds sanity limit (1000); set clock manually to the correct UTC time. |
However I cannot get the system clock anywhere near the GMT time Does anyone have any suggestions? Any would be appreciated. |
|
Back to top |
|
|
think4urs11 Bodhisattva
Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Wed Jul 21, 2004 5:41 pm Post subject: |
|
|
Code: | /etc/init.d/ntpd stop
/usr/bin/ntpdate <your ntp server of choice>
/etc/init.d/ntpd start |
should fix the offset problem
HTH
T. _________________ Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself |
|
Back to top |
|
|
Martz n00b
Joined: 04 Mar 2004 Posts: 72
|
Posted: Thu Jul 22, 2004 12:18 pm Post subject: |
|
|
My problems was caused by not symlinking the correct time zone to /etc/localtime
Because in GMT of daylight savings, my drift was a few seconds + an hour. I was using the GMT, GMT+0 time zones which are all the same as UTC.
Setting the /etc/localtime to GB makes it work perfectly
Now I have my Gentoo box using NTPD querying 2 external NTP servers for the correct time. My Windows domain controlers then get their time from the Gentoo box, and the Win2K workstations sync with the domain controler during login. Complete enterprise time sync working great
Thanks for the guide! |
|
Back to top |
|
|
dob Apprentice
Joined: 04 Oct 2002 Posts: 199 Location: S.L.P.
|
Posted: Sun Jul 25, 2004 4:26 pm Post subject: |
|
|
Anyone tried openntpd yet?
It's supposed to have a saner licence than ntpd, and to be more secure as well (it can be set up to not listen on all network interfaces)
http://openntpd.org/
(and it's already in portage)
I seems to work, however, the usual ntp utilities like ntptrace and ntpq don't seem to work with it. I get the following in syslog:
Code: | Jul 25 18:22:44 tokyo ntpd[17216]: malformed packet received |
And in the term where I run ntpq / ntptrace:
Code: | 127.0.0.1: timed out, nothing received
***Request timed out |
Openntpd is set to listen on 127.0.0.1
Anyone had more luck ? |
|
Back to top |
|
|
dob Apprentice
Joined: 04 Oct 2002 Posts: 199 Location: S.L.P.
|
Posted: Sun Jul 25, 2004 4:26 pm Post subject: |
|
|
To install it just emerge openntpd
Last edited by dob on Thu Jul 29, 2004 10:49 am; edited 1 time in total |
|
Back to top |
|
|
dedbox n00b
Joined: 24 Jul 2004 Posts: 2
|
Posted: Wed Jul 28, 2004 3:44 pm Post subject: hooray for openntpd! |
|
|
Just emerged openntpd-20040719 and my ntp woes are gone.
It is obviously not as flexible as traditional ntpd (which still runs on my gateway), but my workstation's ntpd.conf is much easier to read. Unmerging net-misc/ntp removed all ntp* executables. I assume this means they're not intended for use with openntpd. Only indication that openntpd is working are these lines in my syslog:
Code: | Jul 28 08:25:10 [ntpd] adjusting local clock by 4.096589s
Jul 28 08:29:10 [ntpd] adjusting local clock by 3.900064s
Jul 28 08:32:40 [ntpd] adjusting local clock by 3.703613s
|
I verified the clock was actually moving like this:
Code: | ssh gateway date; date |
|
|
Back to top |
|
|
dob Apprentice
Joined: 04 Oct 2002 Posts: 199 Location: S.L.P.
|
Posted: Thu Jul 29, 2004 10:47 am Post subject: Re: hooray for openntpd! |
|
|
dedbox wrote: | Just emerged openntpd-20040719 and my ntp woes are gone.
Code: | Jul 28 08:25:10 [ntpd] adjusting local clock by 4.096589s
Jul 28 08:29:10 [ntpd] adjusting local clock by 3.900064s
Jul 28 08:32:40 [ntpd] adjusting local clock by 3.703613s
|
| Wow! Your clock drifts by huge margins!
My syslog looks like this
Code: | Jul 28 07:52:32 tokyo ntpd[17215]: adjusting local clock by -0.000837s
Jul 28 08:21:53 tokyo ntpd[17215]: adjusting local clock by -0.001849s
Jul 28 08:41:53 tokyo ntpd[17215]: adjusting local clock by -0.001578s
Jul 28 09:15:42 tokyo ntpd[17215]: adjusting local clock by 0.000151s
Jul 28 09:47:30 tokyo ntpd[17215]: adjusting local clock by -0.000527s
Jul 28 10:07:30 tokyo ntpd[17215]: adjusting local clock by -0.000923s
Jul 28 10:37:33 tokyo ntpd[17215]: adjusting local clock by 0.000115s
Jul 28 11:17:30 tokyo ntpd[17215]: adjusting local clock by 0.000325s |
|
|
Back to top |
|
|
andrewbarr Apprentice
Joined: 09 Jul 2004 Posts: 172 Location: Madison County, Ohio
|
Posted: Thu Jul 29, 2004 4:13 pm Post subject: ntpd constant activity |
|
|
Hi. I followed this guide to set up ntpd and ntp-client on my machine. Once ntpd is started, there is a constant drip of network activity from this machine to my router. The LED light on my switch blinks once every second or so. Is this normal/to be expected? The activity stops when the ntpd daemon is shut down. |
|
Back to top |
|
|
Ladynik0n Tux's lil' helper
Joined: 12 Apr 2004 Posts: 75
|
Posted: Thu Jul 29, 2004 5:15 pm Post subject: confused.. |
|
|
I thought I follows the instructions right but I guess I didnt ..
I got this. Code: | /etc/init.d/ntpd start |
* Starting ntpd...
usage: /usr/bin/ntpd [ -abdgmnqx ] [ -c config_file ] [ -e e_delay ]
[ -f freq_file ] [ -k key_file ] [ -l log_file ]
[ -p pid_file ] [ -r broad_delay ] [ -s statdir ]
[ -t trust_key ] [ -v sys_var ] [ -V default_sysvar ]
[ -P fixed_process_priority ]
[ -u user[:group] ] [ -i chrootdir ]
this is how everything else looks
this is nano /etc/conf.d/ntpd
Code: | # Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/ntp/files/ntpd.confd,v 1.14 2004/02$
# Options to pass to the ntpd process
# Most people should leave this line alone ...
# however, if you know what you're doing, feel free to tweak
NTPD_OPTS="-b cornell"
NTPDATE_CMD="ntpdate"
|
And this is :
Code: | # NOTES:
# - you should only have to update the server line below
# - if you start getting lines like 'restrict' and 'fudge'
# and you didnt add them, AND you run dhcpcd on your
# network interfaces, be sure to add '-Y -N' to the
# dhcpcd_ethX variables in /etc/conf.d/net
# Name of the servers ntpd should sync with
# Please respect the access policy as stated by the responsible person.
#server ntp.example.tld iburst
server clock.linuxshell.net
server ntp0.cornell.edu
server reva.sixgirls.org
##
# A list of available servers is available here:
# http://www.eecis.udel.edu/~mills/ntp/clock2a.html
# http://www.eecis.udel.edu/~mills/ntp/servers.html
# Please follow the rules of engagement and use a
# you should not need to modify the following paths
driftfile /var/lib/ntp/ntp.drift
#server ntplocal.example.com prefer
#server timeserver.example.org
# Warning: Using default NTP settings will leave your NTP
# server accessible to all hosts on the Internet.
# If you want to deny all machines (including your own)
# from accessing the NTP server, uncomment:
#
#restrict default ignore
# To only deny other machines from changing the
# configuration but allow localhost uncomment:
#restrict default notrust nomodify
#restrict 127.0.0.1
# To allow machines within your network to synchronize
# their clocks with your server, but ensure they are
# not allowed to configure the server or used as peers
# to synchronize against, uncomment this line.
#
#restrict 192.168.1.0 mask 255.255.255.0 notrust nomodify notrap
|
What am I not getting |
|
Back to top |
|
|
j__m n00b
Joined: 31 Jul 2004 Posts: 2
|
Posted: Sat Jul 31, 2004 10:33 pm Post subject: Hint |
|
|
OK, do the following:
Sorry to say but the 4.2.0-r2 ebuild is FUBAR and never worked on any of approx. 15 computers I tried.
Also be sure to add appropriate entry to /etc/portage/package.mask to block any future updates to ntp via emerge -u world. |
|
Back to top |
|
|
AMSch Apprentice
Joined: 29 Mar 2004 Posts: 179 Location: Austria
|
Posted: Wed Aug 18, 2004 8:51 am Post subject: |
|
|
Hello!
Ich have successfully installed Opennpt and it looks like it works, but there ist one strange thing:
Im using openntpd on 2 PCs and on both I find the following output ind /var/log/messages
Code: |
Aug 18 10:19:23 neo ntpd[6901]: adjusting local clock by 527.833010s
Aug 18 10:23:25 neo ntpd[6901]: adjusting local clock by 527.711954s
Aug 18 10:25:26 neo ntpd[6901]: adjusting local clock by 527.469137s
|
Code: |
Aug 18 10:00:23 morpheus ntpd[1246]: adjusting local clock by 1429.649724s
Aug 18 10:03:53 morpheus ntpd[1246]: adjusting local clock by 1429.985324s
Aug 18 10:07:23 morpheus ntpd[1246]: adjusting local clock by 1430.341580s
Aug 18 10:11:24 morpheus ntpd[1246]: adjusting local clock by 1430.730004s
Aug 18 10:13:24 morpheus ntpd[1246]: adjusting local clock by 1431.133677s
|
So on both Systems (installed Version of Openntpd 20040719p) there are big time differences and I dont feel that this is normal (since I dont have the "right" time at all) - can anyone help why this is happening? /etc/localtime and Time in rc.conf are set to the right values. |
|
Back to top |
|
|
Dr_Smack n00b
Joined: 15 Jul 2004 Posts: 18
|
Posted: Wed Aug 18, 2004 7:24 pm Post subject: |
|
|
I'm using ntp-4.1.2 and things seem to work, except I never get any messages stating my time was upated in /var/log/messages (or /v/l/ntpd.log). I get the normal startup messages, but never anything after that (I've left it running for weeks). My drift file gets updated throughout the day, but I can't tell if anything else is happening.
Here's my ntp.conf:
Code: |
#First specify log and driftfile:
logfile /var/log/ntpd.log
driftfile /var/lib/ntp/ntp.drift
# Server config
# Because of round robin DNS we get 3 different IP's
server us.pool.ntp.org
server us.pool.ntp.org
server us.pool.ntp.org
# Restrict default access, no ignore because then we block packets from
# the (unknown) servers, still some restrictions so we don't sync the
# internet servers with our hardware time.
restrict default nopeer noquery nomodify
# Now allow some access from lo, don't allow to sync with hardware clock
restrict 127.0.0.1 nopeer
# Allow requests from the local network:
restrict 192.168.1.0 mask 255.255.255.0 nopeer nomodify
|
|
|
Back to top |
|
|
inode77 Veteran
Joined: 20 Jan 2004 Posts: 1303 Location: Heart of Europe
|
Posted: Wed Aug 25, 2004 4:52 am Post subject: |
|
|
Using ntpd makes only sense if you have @ least a couple of computers to synchronize.
For a single machine it does not make any sense because ntpd is:
- too much software => security risk
- too complicated for the average user
- using fat too much resources
I'm not trying to say in any way you should not use ntp but there is an easy replacement which has none of the disadvantages mentioned above. But you can use it only as "client" to synchronize one single machine.
After the tiny bit of software is installed add a line to your crontab similar to the following:
Code: |
5 5 * * * /usr/bin/rdate -s swisstime.ee.ethz.ch &> /dev/null
|
That should do the trick whitout too much hassle with complicated configuration or resourceeating software.
Please do not synchronise more than once a day or seek approval with the timeserver administrators first. The protocol used to synchronize is defined by RFC 868.
http://www.ietf.org/rfc/rfc0868.txt?number=868
I recommend using this to synchronize any site under 5 to 10 machines to synchronize. |
|
Back to top |
|
|
skyfolly Apprentice
Joined: 16 Jul 2003 Posts: 245 Location: Dongguan & Hong Kong, PRC
|
Posted: Thu Sep 02, 2004 2:19 pm Post subject: |
|
|
shit, it never works. _________________ I am the only being whose doom
No tongue would ask no eye would mourn
I never caused a thought of gloom
A smile of joy since I was born.
emily bronte |
|
Back to top |
|
|
Suicidal l33t
Joined: 30 Jul 2003 Posts: 959 Location: /dev/null
|
Posted: Sat Sep 04, 2004 9:14 am Post subject: |
|
|
Im starting to like BSD's openntpd as well its configuration is nearly nonexistent.
Code: | #
# Sample ntpd.conf
# $Id: ntpd.conf,v 1.2 2004/07/17 00:22:19 dtucker Exp $
#
# Adresses to listen on (ntpd does not listen by default)
listen on *
# listen on 127.0.0.1
# listen on ::1
# use a random selection of 8 public stratum 2 servers
# see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers
# servers pool.ntp.org
# Sync to the first active address these resolve to
server pool.ntp.org
server pool.ntp.org
server pool.ntp.org
|
This is from my server @ work and it is the entire config file. The only value I modified was to uncoment "listen on *"
I use it to keep my AD servers synched since msblast I have had horrible times keeping thier NTP right. Probably because of all the ICMP acl's out there.
With this there is no config unless you want it to be a server, so it would be perfect for client machines, and less teh security risk as well. |
|
Back to top |
|
|
Suicidal l33t
Joined: 30 Jul 2003 Posts: 959 Location: /dev/null
|
Posted: Sat Sep 04, 2004 9:20 am Post subject: |
|
|
AMSch wrote: | Hello!
Ich have successfully installed Opennpt and it looks like it works, but there ist one strange thing:
Im using openntpd on 2 PCs and on both I find the following output ind /var/log/messages
Code: |
Aug 18 10:19:23 neo ntpd[6901]: adjusting local clock by 527.833010s
Aug 18 10:23:25 neo ntpd[6901]: adjusting local clock by 527.711954s
Aug 18 10:25:26 neo ntpd[6901]: adjusting local clock by 527.469137s
|
Code: |
Aug 18 10:00:23 morpheus ntpd[1246]: adjusting local clock by 1429.649724s
Aug 18 10:03:53 morpheus ntpd[1246]: adjusting local clock by 1429.985324s
Aug 18 10:07:23 morpheus ntpd[1246]: adjusting local clock by 1430.341580s
Aug 18 10:11:24 morpheus ntpd[1246]: adjusting local clock by 1430.730004s
Aug 18 10:13:24 morpheus ntpd[1246]: adjusting local clock by 1431.133677s
|
So on both Systems (installed Version of Openntpd 20040719p) there are big time differences and I dont feel that this is normal (since I dont have the "right" time at all) - can anyone help why this is happening? /etc/localtime and Time in rc.conf are set to the right values. |
what is your /etc/localtime and rc.con set to, due to the large drift it looks as if you have the rc.conf set to UTC and /etc/localtime set to your local timezone. other than that I would suspect a buggy or (going) bad hardware such as your rtc. |
|
Back to top |
|
|
frippz Guru
Joined: 22 Aug 2002 Posts: 460 Location: Sweden
|
Posted: Wed Sep 08, 2004 10:25 am Post subject: |
|
|
jjasghar wrote: | Code: |
tito etc # /etc/init.d/ntpd start
* Starting ntpd...
usage: /usr/bin/ntpd [ -abdgmnqx ] [ -c config_file ] [ -e e_delay ]
[ -f freq_file ] [ -k key_file ] [ -l log_file ]
[ -p pid_file ] [ -r broad_delay ] [ -s statdir ]
[ -t trust_key ] [ -v sys_var ] [ -V default_sysvar ]
[ -P fixed_process_priority ]
[ -u user[:group] ] [ -i chrootdir ]
* Failed to start ntpd [ !! ]
|
i get this error trying to start ntp any ideas? |
Yeah, I got that too and it seems that the init script (or whatever reads /etc/conf.d/ntpd) doesn't give a damn that the command to use is ntpdate and not ntpd. Don't know how to fix it though. Seems that ntpd is hardcoded into the init script. |
|
Back to top |
|
|
pharaoh Apprentice
Joined: 20 Nov 2003 Posts: 211 Location: Pennsylvania
|
Posted: Thu Sep 09, 2004 5:32 pm Post subject: |
|
|
I've spent so much time on this that now that my clock is in sync I don't believe how much time has passed since I started working on it...
I'm going to wait a bit until I continue troubleshooting why my clients won't sync to the server. Server seems peachy now otherwise! Thanks to everyone who posted their hearts out
EDIT: IT WORKS!!! Just like Meowsqueak had said earlier, "go to lunch and come back". YAY! The HOWTO should probably be noted about this for newbs like me who think "it's setup correctly, why's it not working?" and then go changing things and breaking it. _________________ RYZEN 5 3600 Matisse (Zen 2) 6-Core 3.6 GHz Socket AM4 65W
ASRock B550M PRO4
Crucial Ballistix 3200 MHz DDR4 DRAM 16GB
EVGA GeForce GTX 1060 6GB |
|
Back to top |
|
|
Skywacker n00b
Joined: 23 Jan 2004 Posts: 72 Location: Missouri
|
Posted: Fri Sep 10, 2004 3:15 pm Post subject: |
|
|
Thanks for the guide. Master node now syncs perfectly and all slaves update from the master.
-Skywacker |
|
Back to top |
|
|
frippz Guru
Joined: 22 Aug 2002 Posts: 460 Location: Sweden
|
Posted: Sat Sep 11, 2004 10:00 am Post subject: |
|
|
I got my time synching working perfect after reading this guide
http://gentoo-wiki.com/HOWTO_NTP
Also, in addition, this guide helped of course. Someone here mentioned to enable DMA on /dev/hda which mine didn't have enabled, so it did the trick! Now my clock doesn't trail one bit (not enough for me to notice anyway ). |
|
Back to top |
|
|
Freejack00 n00b
Joined: 02 Aug 2004 Posts: 22
|
Posted: Mon Oct 04, 2004 8:16 pm Post subject: |
|
|
I think this works if I can figure out why it does this everytime i try to run it:
* Running preup function
* Wireless extensions not found for eth0
* Please make sure that /etc/conf.d/net has $ifconfig_eth0 set
* (or $iface_eth0 for old-style configuration)
* Starting ntpd...
* Failed to start ntpd
I use wireless which is ath0 not eth0. I have been setup like this for months and no problems till now when I try to setup ntp. Any ideas? |
|
Back to top |
|
|
dusty_bin n00b
Joined: 17 Apr 2004 Posts: 7
|
Posted: Wed Oct 27, 2004 10:50 am Post subject: |
|
|
As a noob to all things Linux/Gentoo - I am struggling:
1. ntpd is running with other servers in ntp.conf, but how do I hook up a local ref clock?
For the NMEA (for my Garmin GPS25LVS) is it just a matter of adding server 127.127.20.0 to ntp.conf and creating a symbolic link: ln -s /dev/ttyS0 /dev/gps0? (I dare say the syntax is wrong)
2. if I try to restart using /etc/init.d/ntpd restart, it always fail to start, but starts OK if I reboot. Any ideas?
Currently on NTP v4.1.2 and kernel 2.4.25 - and in the process of trying to work my way through updating portage and then to NTP v4.2.0...
[edit]
Oops, I see this isn't a support list - but it did seem like the most relevant thread at the time.
Anyway point 1 seems to be the correct way as my ref clock is now going. As far as 2 goes, I've no idea - but having completed the portage business, the associated updates of the configuration and upgraded NTP, I don't see the problem anymore.
And now for PPSkit... |
|
Back to top |
|
|
danorris Tux's lil' helper
Joined: 04 Dec 2004 Posts: 108
|
Posted: Sun Dec 05, 2004 12:40 am Post subject: |
|
|
Hmm, I'm having some time zone problems with ntpd. In /etc/rc.conf I have:
And my timezone is set as:
Code: | freya root # file /etc/localtime
/etc/localtime: symbolic link to `/usr/share/zoneinfo/CST6CDT'
freya root # file -L /etc/localtime
/etc/localtime: timezone data |
But when I run "ntpd -q" I get the following output in my syslog:
Code: | Dec 5 18:35:16 [ntpd] ntpd 4.2.0@1.1161-r Fri Dec 3 08:08:58 CST 2004 (1)
Dec 5 18:35:16 [ntpd] precision = 1.000 usec
Dec 5 18:35:16 [ntpd] kernel time sync status 0040
Dec 5 18:35:20 [ntpd] Frequency format error in /var/lib/ntp/ntp.drift
Dec 5 18:35:25 [ntpd] synchronized to 64.113.215.94, stratum=2
Dec 5 18:35:25 [ntpd] time correction of -86414 seconds exceeds sanity limit (1000); set clock manually to the correct UTC time. |
And finally here's my ntp.conf (comments stripped):
Code: | server us.pool.ntp.org
server us.pool.ntp.org
server us.pool.ntp.org
server us.pool.ntp.org
driftfile /var/lib/ntp/ntp.drift
restrict default nomodify nopeer
restrict 127.0.0.1 |
Any ideas? |
|
Back to top |
|
|
danorris Tux's lil' helper
Joined: 04 Dec 2004 Posts: 108
|
Posted: Sun Dec 05, 2004 12:44 am Post subject: |
|
|
NEVERMIND!
I just noticed -86414 seconds is almost exactly 24 hours. Yep, my clock was off by a whole day. Thought it was 12/5 when it's really 12/4. The time was right though.
All fixed, thanks anyway and sorry for the retarded post! |
|
Back to top |
|
|
|