Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Ntp
Jim
post Oct 13 2004, 07:12 PM
Post #1


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,280
Joined: 19-November 03
From: University of Minnesota- TC
Member No.: 1,828



so I am running NTP on my gentoo box right. Installed it with emerge, and it is almost always like 10 mins or so ahead. Why, I do not know, but it is.

ntp is in my start up script, so its running when I boot up, but it just always keeps it ten mins ahead, what should I do to fix this?

o ya, I am using the military servers tic and toc for my servers. Somehow I was getting my time from the U here but I don't know how that happened since I didn't add it to my list of servers.


--------------------
--Jim Lester
jim@linuxhelp.net

Distro: Gentoo
System: AMD Athlon 3000+ XP 2.166 GHz
NVIDIA nForce2 IGP Chipset
1GB 333 MHz DDR SDRAM
NVIDIA nForce2 Dual Head 64 MB Graphics

Server Distro: CentOS
Go to the top of the page
 
+Quote Post
hughesjr
post Oct 13 2004, 07:24 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



Take a look in the file /etc/ntp.conf

Also you can run the command:

ntpq

in that prompt, type peers and you will get the info about what you are synced to...

See if you are running ntpd at startup ... do:

ls -al /etc/runlevels/default/ | grep ntp

It should say

lrwxrwxrwx 1 root root 16 Mar 27 2004 ntpd -> /etc/init.d/ntpd


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
Jim
post Oct 18 2004, 09:15 PM
Post #3


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,280
Joined: 19-November 03
From: University of Minnesota- TC
Member No.: 1,828



its still screwed up. Right now its reading just shy of 20 mins ahead.

This is the output of ntpq> peers

CODE
jim@argento jim $ ntpq
ntpq> peers
    remote           refid      st t when poll reach   delay   offsetjitter
==============================================================================
tock.usno.navy. .RSTR.          16 u    -  128    0    0.000    0.000 4000.00
tick.usno.navy. .RSTR.          16 u    - 1024    0    0.000    0.000 4000.00
ntpq>


So I am connected to tick and tock. But for what ever reason its 20 mins off.

CODE
jim@argento jim $ ls -al /etc/runlevels/default/ | grep ntp
lrwxrwxrwx  1 root root  16 Oct  4 01:03 ntpd -> /etc/init.d/ntpd


That seems right to. I don't get it.


--------------------
--Jim Lester
jim@linuxhelp.net

Distro: Gentoo
System: AMD Athlon 3000+ XP 2.166 GHz
NVIDIA nForce2 IGP Chipset
1GB 333 MHz DDR SDRAM
NVIDIA nForce2 Dual Head 64 MB Graphics

Server Distro: CentOS
Go to the top of the page
 
+Quote Post
hughesjr
post Oct 18 2004, 10:13 PM
Post #4


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



Actually, you are not connected ... when connected, it looks like this:

CODE
ntpq> peers
    remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*navobs1.wustl.e .USNO.           1 u  522 1024  377   69.993   -3.092   3.133
+ntp1.usno.navy. .USNO.           1 u   32 1024  375  204.165   47.201  16.480
+tick.usno.navy. .USNO.           1 u 1979 1024  156  190.956   31.622  30.760


So it looks like you may have a firewall issue...


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
Jim
post Oct 18 2004, 11:16 PM
Post #5


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,280
Joined: 19-November 03
From: University of Minnesota- TC
Member No.: 1,828



I haven't even touched my firewall since I set up my system, so its got to be how ever gentoo has it set by default.

So what port do I need to open and what do I need to do to open it?


--------------------
--Jim Lester
jim@linuxhelp.net

Distro: Gentoo
System: AMD Athlon 3000+ XP 2.166 GHz
NVIDIA nForce2 IGP Chipset
1GB 333 MHz DDR SDRAM
NVIDIA nForce2 Dual Head 64 MB Graphics

Server Distro: CentOS
Go to the top of the page
 
+Quote Post
hughesjr
post Oct 19 2004, 06:20 AM
Post #6


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



In looking at my /var/lib/iptables/rules-save, I don't have anything in there about ntp either...

so I'm not sure why you aren't working

I am going to include several items from my setup:
-------------------------------------------
Here are all the uncommented lines in /etc/ntp.conf
CODE
logfile         /var/log/ntpd.log
driftfile       /var/lib/ntp/ntp.drift

server tick.wustl.edu
server tock.usno.navy.mil
server tick.usno.navy.mil

restrict 192.168.0.0 mask 255.255.255.0 notrust nomodify notrap

(the last line is not super important ... and restricts who can sync with this server {that is, my internal netowrk only}, it shouldn't effect the client)
---------------------------------------
here are the uncommented lines in /etc/conf.d/ntp-client
CODE
NTPCLIENT_CMD="ntpdate"

NTPCLIENT_OPTS="-b 192.168.0.2"

(I use another time server on my network for the initial time sync {192.168.0.2}, you can probably leave this remarked out, OR set it to NTPCLIENT_OPTS="-b pool.ntp.org"
---------------------------------------
Here are all the uncommented lines for /etc/conf.d/ntpd
CODE
NTPD_OPTS="-u ntp:ntp"

---------------------------------------
I would copy the current files to .bak, then update each with what I gave you and see if it starts sync'ing ... (after changing the files do /etc/init.d/ntp-client restart and /etc/init.d/ntpd restart)

If you still can't sync, I would recommend that you turn off your firewall (/etc/init.d/iptables stop), restart the ntp-client and ntpd services, wait 30 minutes and see if they sync ... if they do, it is an IPTABLES problem ... if not, something else is the issue (maybe a school proxy/firewall).


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
Jim
post Oct 19 2004, 02:14 PM
Post #7


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,280
Joined: 19-November 03
From: University of Minnesota- TC
Member No.: 1,828



so some how, I have no idea, my /etc/ntp.conf file got changed. It used to look like yours (more or less) with tick and toc and the servers, now it looks like this.

CODE
restrict default noquery notrust nomodify
restrict 127.0.0.1
restrict 134.84.100.0 mask 255.255.255.128
restrict 134.84.84.84
server 134.84.84.84
restrict 128.101.101.101
server 128.101.101.101


And I get this from a ntpq> peers
CODE
jim@argento jim $ ntpq
ntpq> peers
    remote           refid      st t when poll reach   delay   offset  jitter
==================================================
nss.nts.umn.edu 160.94.54.248    2 u  428 1024  377    1.734  -128032 3441.93
ns.nts.umn.edu  160.94.54.248    2 u  432 1024  377    8.179  -128031 3445.44
ntpq>


So it looks like I am actually connected to the UofM's times servers, but my clock is still off by over 20 mins.

So I don't know how that happened. Is it possible a env-update did it?

I am going to replace the stuff with tic and toc and see what happens.


--------------------
--Jim Lester
jim@linuxhelp.net

Distro: Gentoo
System: AMD Athlon 3000+ XP 2.166 GHz
NVIDIA nForce2 IGP Chipset
1GB 333 MHz DDR SDRAM
NVIDIA nForce2 Dual Head 64 MB Graphics

Server Distro: CentOS
Go to the top of the page
 
+Quote Post
Jim
post Oct 19 2004, 02:23 PM
Post #8


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,280
Joined: 19-November 03
From: University of Minnesota- TC
Member No.: 1,828



CODE
jim@argento jim $ ntpq
ntpq> peers
    remote           refid      st t when poll reach   delay   offset  jitter
=====================================================
tock.usno.navy. .USNO.           1 u  212  256   15  187.980  -128254 346.775
tick.usno.navy. .USNO.           1 u  146  512   21  215.815  -128320 869.130
ntpq> time
primary timeout 5000 ms
ntpq> quit


So it would apear that I am connected, now how do I get it to actually change my clock since its still 20 mins ahead?


--------------------
--Jim Lester
jim@linuxhelp.net

Distro: Gentoo
System: AMD Athlon 3000+ XP 2.166 GHz
NVIDIA nForce2 IGP Chipset
1GB 333 MHz DDR SDRAM
NVIDIA nForce2 Dual Head 64 MB Graphics

Server Distro: CentOS
Go to the top of the page
 
+Quote Post
hughesjr
post Oct 19 2004, 08:42 PM
Post #9


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



There is a maximum time, above which no adjustment is made. Set your time a little closer to the real time and NTP will then adjust it.

set it like this:

date MMDDhhmmyyyy

so 10/19/2004 at 20:51 would be:

date 101920512004

after you get closer, it should maintain the time.
-------------
I have never had env-update change my ntp.conf file ... but it might make changes based on your network subnet. So if you are on the same subnet as the time server at UM and it is registered at pool.ntp.org, etc-update might have set the servers in your ntp.conf. I am on a 192.168.x.x subnet, so it might have left mine alone.


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
Jim
post Oct 20 2004, 02:27 PM
Post #10


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,280
Joined: 19-November 03
From: University of Minnesota- TC
Member No.: 1,828



It still shows that I am connected to the nave time servers, but my clock is still off by like 5 mins. Any other god ideas?


--------------------
--Jim Lester
jim@linuxhelp.net

Distro: Gentoo
System: AMD Athlon 3000+ XP 2.166 GHz
NVIDIA nForce2 IGP Chipset
1GB 333 MHz DDR SDRAM
NVIDIA nForce2 Dual Head 64 MB Graphics

Server Distro: CentOS
Go to the top of the page
 
+Quote Post
hughesjr
post Oct 20 2004, 07:28 PM
Post #11


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



something is very odd with the install ... I would try to unmerge ntp, delete the ntpd.conf (save your server IPs) file, and then re-emerge it and adjust your /etc/ntp.conf file.

emerge unmerge ntp
del /etc/ntp.conf
emerge ntp


After running for about an hour, it should adjust your time.


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
hughesjr
post Oct 23 2004, 06:52 AM
Post #12


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



Did your NTP ever adjust the clock?


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
Jim
post Oct 24 2004, 05:18 PM
Post #13


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,280
Joined: 19-November 03
From: University of Minnesota- TC
Member No.: 1,828



Ok, so my NTP is still tweeking out.

It still doesn't adjust my clock.

This is my /etc/ntp.conf file:
CODE
restrict default noquery notrust nomodify
restrict 127.0.0.1
restrict 134.84.100.0 mask 255.255.255.128
restrict 134.84.84.84
server 134.84.84.84
restrict 128.101.101.101
server 128.101.101.101
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log


Which looks nothing like it did the last time I saw it. The last time I saw it, it was chock full of comments and the servers were set to tick and tock.

So now with that ntp.conf file this is what I get from peers.
CODE
jim@argento jim $ ntpq
ntpq> peers
    remote           refid      st t when poll reach   delay   offsetjitter
===========================================================
nss.nts.umn.edu 160.94.54.248    2 u  434 1024  377    1.471  -222949 3440.51
ns.nts.umn.edu  160.94.54.248    2 u  493 1024  377    1.617  -222751 3433.62
ntpq> quit


So I have no idea why its doing that. There might be something wierd with an ntp time server on campus, but I don't know who I would even go ask about that. Maybe I am just doomed to have it not work.


--------------------
--Jim Lester
jim@linuxhelp.net

Distro: Gentoo
System: AMD Athlon 3000+ XP 2.166 GHz
NVIDIA nForce2 IGP Chipset
1GB 333 MHz DDR SDRAM
NVIDIA nForce2 Dual Head 64 MB Graphics

Server Distro: CentOS
Go to the top of the page
 
+Quote Post
hughesjr
post Oct 25 2004, 05:16 PM
Post #14


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



get rid of all the restrict stuff for now, and just put in these lines:

CODE
server tick.wustl.edu
server tock.usno.navy.mil
server tick.usno.navy.mil


logfile         /var/log/ntpd.log
driftfile       /var/lib/ntp/ntp.drift


Then, do:

chmod 444 /etc/ntp.conf

Then see what happens...(you will have to do chmod 644 /etc/ntp.conf later as root to change the file). That should keep it from changing.


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
Jim
post Nov 2 2004, 01:34 AM
Post #15


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,280
Joined: 19-November 03
From: University of Minnesota- TC
Member No.: 1,828



This is just totally jacked up.

Right, so my windows system crashed so I had to fix that, so now I am back to linux and I want to have the right time.

So, I edited it and changed the permision right, even with the permision at 444 it still changes the file when I reboot.

So I change it to look like the one above right, and when I reboot it looks like this.

CODE
restrict default noquery notrust nomodify
restrict 127.0.0.1
restrict 134.84.100.0 mask 255.255.255.128
restrict 134.84.84.84
server 134.84.84.84
restrict 128.101.101.101
server 128.101.101.101
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log


and a ntpq> peers looks like this
CODE
ntpq> peers
    remote           refid      st t when poll reach   delay   offsetjitter
=========================================================
ns.nts.umn.edu  160.94.54.248    2 u   63   64    3    1.185  8971966 211.464
ntpq>


So some how either it just so happens that the university runs its servers on the default connection, or maybe the U's time servers are high jacking mine, either way, its almost 40 mins off now. So I don't know what the hell to do.


--------------------
--Jim Lester
jim@linuxhelp.net

Distro: Gentoo
System: AMD Athlon 3000+ XP 2.166 GHz
NVIDIA nForce2 IGP Chipset
1GB 333 MHz DDR SDRAM
NVIDIA nForce2 Dual Head 64 MB Graphics

Server Distro: CentOS
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 16th October 2017 - 11:15 PM