ntpd -gq not working

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat ntpd -gq not working
# 1  
Old 08-29-2010
ntpd -gq not working

as advised and documented, i'm trying to use the ntpd -gq instead of ntpdate. The result is that clock not set. as below. However ntpdate is working ok and had set the clock correctly

this is the ntp.conf file:

Code:
[root@CentOS5 ~]# cat /etc/ntp.conf
logfile  /var/log/ntp.log
driftfile /var/lib/ntp/drift
server 0.centos.pool.ntp.org

this is the output of command:
Code:
[root@CentOS5 ~]# ntpd -dqg
ntpd 4.2.2p1@1.1570-o Sat Dec 19 00:58:16 UTC 2009 (1)
addto_syslog: precision = 1.000 usec
create_sockets(123)
addto_syslog: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
bind() fd 16, family 2, port 123, addr 0.0.0.0, flags=9
Added addr 0.0.0.0 to list of addresses
addto_syslog: Listening on interface wildcard, 0.0.0.0#123 Disabled
bind() fd 17, family 10, port 123, addr ::, flags=1
Added addr :: to list of addresses
addto_syslog: Listening on interface wildcard, ::#123 Disabled
bind() fd 18, family 10, port 123, addr ::1, flags=1
Added addr ::1 to list of addresses
addto_syslog: Listening on interface lo, ::1#123 Enabled
bind() fd 19, family 10, port 123, addr fe80::20c:29ff:fedc:9809, flags=1
Added addr fe80::20c:29ff:fedc:9809 to list of addresses
addto_syslog: Listening on interface eth0, fe80::20c:29ff:fedc:9809#123 Enabled
bind() fd 20, family 2, port 123, addr 127.0.0.1, flags=5
Added addr 127.0.0.1 to list of addresses
addto_syslog: Listening on interface lo, 127.0.0.1#123 Enabled
bind() fd 21, family 2, port 123, addr 192.168.180.129, flags=25
Added addr 192.168.180.129 to list of addresses
addto_syslog: Listening on interface eth0, 192.168.180.129#123 Enabled
init_io: maxactivefd 21
local_clock: time 0 base 0.000000 offset 0.000000 freq 0.000 state 0
addto_syslog: frequency initialized 0.000 PPM from /var/lib/ntp/drift

key_expire: at 0
peer_clear: at 0 next 1 assoc ID 53071 refid INIT
newpeer: 192.168.180.129->194.38.104.240 mode 3 vers 4 poll 6 10 flags 0x201 0x1 ttl 0 key 00000000
local_clock: time 0 base 0.000000 offset 0.000000 freq 0.000 state 1
report_event: system event 'event_restart' (0x01) status 'sync_alarm, sync_unspec, 1 event, event_unspec' (0xc010)
transmit: at 1 192.168.180.129->194.38.104.240 mode 3
auth_agekeys: at 1 keys 1 expired 0
timer: refresh ts 0
1 receive: at 1 192.168.180.129<-194.38.104.240 mode 4 code 1 auth 0
peer 194.38.104.240 event 'event_reach' (0x84) status 'unreach, conf, 1 event, event_reach' (0x8014)
clock_filter: n 1 off 42904.765724 del 0.610083 dsp 7.937506 jit 0.000001, age 0
transmit: at 2 192.168.180.129->194.38.104.240 mode 3
3 receive: at 2 192.168.180.129<-194.38.104.240 mode 4 code 1 auth 0
clock_filter: n 2 off 42905.489022 del 0.390840 dsp 3.937510 jit 0.723298, age 0
4 transmit: at 4 192.168.180.129->194.38.104.240 mode 3
5 receive: at 4 192.168.180.129<-194.38.104.240 mode 4 code 1 auth 0
clock_filter: n 3 off 42905.489022 del 0.390840 dsp 1.937534 jit 1.572867, age 2
6 transmit: at 6 192.168.180.129->194.38.104.240 mode 3
7 receive: at 7 192.168.180.129<-194.38.104.240 mode 4 code 1 auth 0
clock_filter: n 3 off 42905.489022 del 0.390840 dsp 0.937575 jit 1.572867, age 5
8 transmit: at 8 192.168.180.129->194.38.104.240 mode 3
9 receive: at 9 192.168.180.129<-194.38.104.240 mode 4 code 1 auth 0
clock_filter: n 3 off 42905.489022 del 0.390840 dsp 0.437603 jit 1.572867, age 7
10 transmit: at 10 192.168.180.129->194.38.104.240 mode 3
11 receive: at 10 192.168.180.129<-194.38.104.240 mode 4 code 1 auth 0
clock_filter: n 4 off 42905.489022 del 0.390840 dsp 0.187593 jit 2.808103, age 8
12 transmit: at 12 192.168.180.129->194.38.104.240 mode 3
13 receive: at 12 192.168.180.129<-194.38.104.240 mode 4 code 1 auth 0
clock_filter: n 5 off 42905.489022 del 0.390840 dsp 0.062621 jit 3.808021, age 10
14 transmit: at 14 192.168.180.129->194.38.104.240 mode 3
15 receive: at 14 192.168.180.129<-194.38.104.240 mode 4 code 1 auth 0
clock_filter: n 6 off 42905.489022 del 0.390840 dsp 0.000132 jit 4.733917, age 12
16 addto_syslog: no reply; clock not set


Also attached is the trace file, from the trace file, everything seems ok, timestamps is sent and received:
# 2  
Old 08-29-2010
How come you do not have a restrict statement in your /etc/ntp.conf? Something like
Code:
restrict default kod nomodify notrap nopeer noquery

# 3  
Old 08-29-2010
when no restrict statement is there, the access is allowed for everything and everyhosts. this is from the man page of ntp_acc:

Quote:
A default entry (address 0.0.0.0, mask 0.0.0.0) is always included and is always the first entry in the list. Note that the text string default, with no mask option, may be used to indicate the default entry.
i have added the restrict to the config and the result is the same:

Code:
[root@CentOS5 ~]# cat /etc/ntp.conf
logfile  /var/log/ntp.log
driftfile /var/lib/ntp/drift
restrict 0.centos.pool.ntp.org
server 0.centos.pool.ntp.org


Last edited by ahmad.zuhd; 08-29-2010 at 11:11 PM..
# 4  
Old 08-30-2010
Please add this line to the top of your ntp.conf file
Code:
restrict default kod nomodify notrap nopeer noquery

and remove the line
Code:
restict 0.centos.pool.ntp.org

and try again.
# 5  
Old 08-31-2010
as i said before, restrict 0.centos.pool.ntp.org will allow all ntp traffic for the mentioned host. the code:
Code:
restrict default kod nomodify notrap nopeer noquery

will create a default rule for all hosts not mentioned explicitly.

anyway, i have tried your suggestion but i still face the same problem. i'm afraid that it is a bug in the distribution.
# 6  
Old 09-06-2010
Which Centos distribution are you using?
# 7  
Old 09-07-2010
Code:
[root@CentOS5 ~]# uname -a
Linux CentOS5 2.6.18-194.11.1.el5 #1 SMP Tue Aug 10 19:09:06 EDT 2010 i686 i686 i386 GNU/Linux

Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Debian

Ntpd slow start

on every boot, ntpd takes long time to start (after moving from dhcp to static ip). is there a way to speed it up? (1 Reply)
Discussion started by: orange47
1 Replies

2. Solaris

Is ntpdate command dependent on ntpd?

Hi, Could someone Please clarify me here: Is ntpdate command a part of ntpd, i mean does ntpdate command a dependent on ntpd? and can ntpdate be run in absence of ntpd service. (5 Replies)
Discussion started by: aksijain
5 Replies

3. AIX

ntpd version

How to check the ntpd version of AIX 5.3 ? (3 Replies)
Discussion started by: alanlkw
3 Replies

4. Linux

NTPD seems to be not syncing !!!

Hi Linux Admin Guys My onsite server is always 15 min slow and seems like NTPD (Network Time Protocol (NTP) daemon) not running properly. can anyone suggest me how to rectify this problem? we can't seem to get NTP to properly sync the clock. Any help is resolving the issue will be helpful.... (12 Replies)
Discussion started by: csaha
12 Replies

5. HP-UX

Ntpd

Hello, I'm looking for assitance on setting up network time protocol on my HP-ux boxes. I have edit the .conf file accordingly. And /etc/services. But whenever I try and start the service nothing happens at all. No error message, nothing. I have a SCO box as a time server and I wish... (0 Replies)
Discussion started by: satinet
0 Replies
Login or Register to Ask a Question