[ntp:questions] Re: ntp: simple question

Mike G. mqg99 at cs.com
Thu Jan 15 16:30:12 UTC 2004


mqg99 at cs.com (Mike G.) wrote in message news:<566c1840.0401140821.529c3a87 at posting.google.com>...
> Christian Vogel <chris-usenet at hedonism.cx> wrote in message news:<bsq39m$8r6o$1 at ID-101457.news.uni-berlin.de>...
> > Hi Mike,
> > 
> > Mike G. wrote:
> > > Can I make ntp NEVER adjust time by more than a second (actually less
> > > than a second), backwards (forward doesn't matter), not even at
> > > startup?
> > 
> > I think that's what the -x option to ntpd and/or the "tinker step NNN"
> > statement in ntp.conf is for. If the time offset is greater than the
> > step-threshold (-x sets it to 600 seconds), ntp will step the clock, if
> > it's less, it will slew it. Setting the panic-threshold to less than the
> > step-threshold (which is the maximum offset, if the offsets gets bigger,
> > ntp will just quit), ntp will never step the clock but only slew it.
> > 
> > See http://www.eecis.udel.edu/~mills/ntp/html/miscopt.html and
> > http://www.eecis.udel.edu/~mills/ntp/html/ntpd.html.
> > 
> >         Chris
> 
> Chris,
> 
> My apologies for my late reply and thanks for the info.  I think my
> original problem was having different versions of ntpd on the
> different platforms.  In any case, I downloaded ntpd 4.2.0 and at
> least my commands run consistently.
> 
> So, I successfully got ntpd -x to start on four different platforms:
> AIX 5.2, Tru64 5.1a, Redhat Linux 8, and Redhat Enterprise Linux WS 3.
> However, the time continues to drift away on the Redhat platforms.  On
> AIX and Tru64 the time is within less a hundredth of a second.  But on
> Redhat, it continues to drift.  I can however synch up the time on all
> platform using ntpdate -b ntpserver.  But ntpd -x does not seem to do
> the job on the Redhat platforms.  Any ideas are greatly appreciated.
> 
> Here's the /etc/ntp.conf on both Redhat servers (same problem with a
> stratum 2 server like time.nist.gov):
> 
> grep -v ^\# /etc/ntp.conf
> restrict default ignore
>  
> restrict 127.0.0.1
>  
> server  ntpserver.micol.com version 1 # local clock
> server  127.127.1.0 # local clock
> fudge   127.127.1.0 stratum 10
>  
> driftfile /var/lib/ntp/drift
> broadcastdelay  0.008
>  
> authenticate yes
>  
> keys            /etc/ntp/keys
> 
> Here's the (lengthy) debug output from both Redhat versions:
> 
> Redhat Linux 8
> --------------
> [root at tstserver root]# ntpd -D4 -x
> Debug1: 4 -> 4 = 4
> ntpd 4.1.2 at 1.892 Thu Sep 11 05:38:15 EDT 2003 (1)
> Debug1: 4 -> 4 = 4
> create_sockets(123)
> interface <lo> OK
> interface <eth0> OK
> bind() fd 4, family 2, port 123, addr 0.0.0.0, flags=1
> flags for fd 4: 04002
> bind() fd 5, family 2, port 123, addr 127.0.0.1, flags=0
> flags for fd 5: 04002
> bind() fd 6, family 2, port 123, addr 141.138.3.80, flags=1
> flags for fd 6: 04002
> create_sockets: ninterfaces=3
> interface 0:  fd=4,  bfd=0,  name=wildcard,  flags=0x1
>               sin=0.0.0.0  bcast=0.0.0.0,  mask=255.255.255.255
> interface 1:  fd=5,  bfd=0,  name=lo,  flags=0x4
>               sin=127.0.0.1  mask=255.0.0.0
> interface 2:  fd=6,  bfd=0,  name=eth0,  flags=0x1
>               sin=141.138.3.80  bcast=141.138.255.255, 
> mask=255.255.0.0
> init_io: maxactivefd 6
> Debug2: 4 -> 4 = 4
> getnetnum 127.0.0.1 step 0 buf 127 temp 127 netnum 127
> getnetnum 127.0.0.1 step 1 buf 0 temp 0 netnum 32512
> getnetnum 127.0.0.1 step 2 buf 0 temp 0 netnum 8323072
> getnetnum 127.0.0.1 step 3 buf 1 temp 1 netnum 2130706433
> getnetnum given 127.0.0.1, got 127.0.0.1 (7f000001)
> getnetnum: "" invalid host numberntpserver.micol.com.
> resolving ntpserver.micol.com
> config: ntpserver.micol.com 3 4 6 10 0 0 0 *
> getnetnum 127.127.1.0 step 0 buf 127 temp 127 netnum 127
> getnetnum 127.127.1.0 step 1 buf 127 temp 127 netnum 32639
> getnetnum 127.127.1.0 step 2 buf 1 temp 1 netnum 8355585
> getnetnum 127.127.1.0 step 3 buf 0 temp 0 netnum 2139029760
> getnetnum given 127.127.1.0, got 127.127.1.0 (7f7f0100)
> peer_clear: at 0 assoc ID 0
> newpeer: 127.0.0.1->127.127.1.0 mode 3 vers 4 poll 6 6 flags 21 1 ttl
> 0 key 0000
> 0000
> getnetnum 127.127.1.0 step 0 buf 127 temp 127 netnum 127
> getnetnum 127.127.1.0 step 1 buf 127 temp 127 netnum 32639
> getnetnum 127.127.1.0 step 2 buf 1 temp 1 netnum 8355585
> getnetnum 127.127.1.0 step 3 buf 0 temp 0 netnum 2139029760
> getnetnum given 127.127.1.0, got 127.127.1.0 (7f7f0100)
> authtrust: keyid 0000ffff life 1
> report_event: system event 'event_restart' (0x01) status 'sync_alarm,
> sync_unspe
> c, 1 event, event_unspec' (0xc010)
> auth_agekeys: at 1 keys 1 expired 0
> input_handler: if=1 fd=5 length 180 from 7f000001 127.0.0.1
> receive: at 2 127.0.0.1<-127.0.0.1 restrict 00
> process_private: impl 2 req 10
> found request in tables
> process_private: all okay, into handler
> peer_clear: at 2 assoc ID 0
> newpeer: 141.138.3.80->141.138.1.59 mode 3 vers 4 poll 6 10 flags 1 1
> ttl 0 key
> 00000000
> sendpkt(fd=5 dst=127.0.0.1, src=127.0.0.1, ttl=-1, len=8)
> poll_update: at 7 141.138.1.59 flags 0001 poll 6 burst 0 last 7 next
> 70
>         MCAST   *****sendpkt(fd=6 dst=141.138.1.59, src=141.138.3.80,
> ttl=0, len
> =48)
> transmit: at 7 141.138.3.80->141.138.1.59 mode 3
> input_handler: if=2 fd=6 length 48 from 958a013b 141.138.1.59
> receive: at 7 141.138.3.80<-141.138.1.59 restrict 01
> refclock_transmit: at 9 127.127.1.0
> refclock_receive: at 9 127.127.1.0
> peer LOCAL(0) event 'event_reach' (0x84) status 'unreach, conf, 1
> event, event_r
> each' (0x8014)
> refclock_sample: n 1 offset 0.000000 disp 0.010000 jitter 0.000000
> clock_filter: n 1 off 0.000000 del 0.000000 dsp 7.937531 jit 0.000031,
> age 0
> poll_update: at 9 127.127.1.0 flags 0021 poll 6 burst 0 last 9 next 75
> auth_agekeys: at 60 keys 1 expired 0
> poll_update: at 70 141.138.1.59 flags 0001 poll 6 burst 0 last 70 next
> 136
>         MCAST   *****sendpkt(fd=6 dst=141.138.1.59, src=141.138.3.80,
> ttl=0, len
> =48)
> transmit: at 70 141.138.3.80->141.138.1.59 mode 3
> input_handler: if=2 fd=6 length 48 from 958a013b 141.138.1.59
> receive: at 70 141.138.3.80<-141.138.1.59 restrict 01
> refclock_transmit: at 75 127.127.1.0
> refclock_receive: at 75 127.127.1.0
> refclock_sample: n 1 offset 0.000000 disp 0.010000 jitter 0.000000
> clock_filter: n 2 off 0.000000 del 0.000000 dsp 3.937793 jit 0.000031,
> age 0
> poll_update: at 75 127.127.1.0 flags 0021 poll 6 burst 0 last 75 next
> 138
> auth_agekeys: at 120 keys 1 expired 0
> poll_update: at 136 141.138.1.59 flags 0001 poll 6 burst 0 last 136
> next 199
>         MCAST   *****sendpkt(fd=6 dst=141.138.1.59, src=141.138.3.80,
> ttl=0, len
> =48)
> transmit: at 136 141.138.3.80->141.138.1.59 mode 3
> input_handler: if=2 fd=6 length 48 from 958a013b 141.138.1.59
> receive: at 136 141.138.3.80<-141.138.1.59 restrict 01
> refclock_transmit: at 138 127.127.1.0
> refclock_receive: at 138 127.127.1.0
> refclock_sample: n 1 offset 0.000000 disp 0.010000 jitter 0.000000
> clock_filter: n 2 off 0.000000 del 0.000000 dsp 1.938032 jit 0.000031,
> age 0
> poll_update: at 138 127.127.1.0 flags 0021 poll 6 burst 0 last 138
> next 201
> auth_agekeys: at 180 keys 1 expired 0
> poll_update: at 199 141.138.1.59 flags 0001 poll 6 burst 0 last 199
> next 265
>         MCAST   *****sendpkt(fd=6 dst=141.138.1.59, src=141.138.3.80,
> ttl=0, len
> =48)
> transmit: at 199 141.138.3.80->141.138.1.59 mode 3
> input_handler: if=2 fd=6 length 48 from 958a013b 141.138.1.59
> receive: at 199 141.138.3.80<-141.138.1.59 restrict 01
> refclock_transmit: at 201 127.127.1.0
> refclock_receive: at 201 127.127.1.0
> refclock_sample: n 1 offset 0.000000 disp 0.010000 jitter 0.000000
> clock_filter: n 2 off 0.000000 del 0.000000 dsp 0.938210 jit 0.000031,
> age 0
> select: low 1000000000.000000 high -1000000000.000000
> select: 127.127.1.0 distance 160.948240
> select: survivors 0 select 0.000031 peer 0.000031
> select: 127.127.1.0 offset 0.000000, distance 160.948240 poll 1
> poll_update: at 201 127.127.1.0 flags 0061 poll 6 burst 0 last 138
> next 203
> select: combine offset 0.000000
> report_event: system event 'event_peer/strat_chg' (0x04) status
> 'sync_alarm, syn
> c_local_proto, 2 events, event_restart' (0xc521)
> clock_update: at 201 assoc 2
> local_clock: assocID 4044 off 0.000000 jit 0.000043 sta 1
> clock_minstep 64.000000 s
> local_clock: mu 201 noi 34.120 stb 0.000 pol 4 cnt 0
> report_event: system event 'event_sync_chg' (0x03) status 'leap_none,
> sync_local
> _proto, 3 events, event_peer/strat_chg' (0x534)
> report_event: system event 'event_peer/strat_chg' (0x04) status
> 'leap_none, sync
> _local_proto, 4 events, event_sync_chg' (0x543)
> poll_update: at 201 127.127.1.0 flags 0061 poll 6 burst 0 last 201
> next 265
> auth_agekeys: at 240 keys 1 expired 0
> [root at tstserver root]#
> 
> 
> 
> Red Hat Enterprise Linux WS release 3
> -------------------------------------
> Linux tst2server at SIS:/root # ntpd -D4 -x
> Debug1: 4 -> 4 = 4
> ntpd 4.2.0 at 1.1161-r Tue Jan 13 13:50:10 MST 2004 (1)
> Debug1: 4 -> 4 = 4
> addto_syslog: ntpd 4.2.0 at 1.1161-r Tue Jan 13 13:50:10 MST 2004 (1)
> addto_syslog: signal_no_reset: signal 13 had flags 4000000
> addto_syslog: set_process_priority: Leave priority alone:
> priority_done is <2>
> addto_syslog: precision = 1.000 usec
> create_sockets(123)
> addto_syslog: no IPv6 interfaces found
> address_okay: listen Virtual: 1, IF name: lo, Up Flag: 1
> address_okay: listen Virtual: 1, IF name: eth0, Up Flag: 1
> bind() fd 4, family 2, port 123, addr 0.0.0.0, flags=8
> flags for fd 4: 04002
> bind() fd 5, family 2, port 123, addr 127.0.0.1, flags=0
> flags for fd 5: 04002
> bind() fd 6, family 2, port 123, addr 141.138.16.220, flags=8
> flags for fd 6: 04002
> create_sockets: ninterfaces=3
> interface 0:  fd=4,  bfd=-1,  name=wildcard,  flags=0x8
>               sin=0.0.0.0  bcast=0.0.0.0,  mask=255.255.255.255
> interface 1:  fd=5,  bfd=-1,  name=lo,  flags=0x5
>               sin=127.0.0.1  mask=255.0.0.0
> interface 2:  fd=6,  bfd=-1,  name=eth0,  flags=0x9
>               sin=141.138.16.220  bcast=141.138.19.255, 
> mask=255.255.252.0
> init_io: maxactivefd 6
> local_clock: at 0 state 0
> Debug2: 4 -> 4 = 4
> getaddrinfo 127.0.0.1
> getnetnum given 127.0.0.1, got 127.0.0.1
> getaddrinfo ntpserver.micol.com
> getnetnum given ntpserver.micol.com, got 141.138.1.59
> key_expire: at 0
> peer_clear: at 0 assoc ID 42700 refid INIT
> newpeer: 141.138.16.220->141.138.1.59 mode 3 vers 4 poll 6 10 flags
> 0x1 0x1 ttl
> 0 key 00000000
> getaddrinfo 127.127.1.0
> getnetnum given 127.127.1.0, got 127.127.1.0
> key_expire: at 0
> peer_clear: at 0 assoc ID 42701 refid INIT
> newpeer: 127.0.0.1->127.127.1.0 mode 3 vers 4 poll 6 6 flags 0x21 0x1
> ttl 0 key
> 00000000
> getaddrinfo 127.127.1.0
> getnetnum given 127.127.1.0, got 127.127.1.0
> addto_syslog: frequency initialized 0.000 PPM from /var/lib/ntp/drift
> local_clock: at 0 state 1
> addto_syslog: configure: keyword "authenticate" unknown, line ignored
> authtrust: keyid 0000ffff life 1
> report_event: system event 'event_restart' (0x01) status 'sync_alarm,
> sync_unspe
> c, 1 event, event_unspec' (0xc010)
> addto_syslog: select(): nfound=-1, error: Interrupted system call
>         MCAST   *****sendpkt(fd=6 dst=141.138.1.59,
> src=141.138.16.220, ttl=0, l
> en=48)
> transmit: at 1 141.138.16.220->141.138.1.59 mode 3
> poll_update: at 1 141.138.1.59 flags 0001 poll 6 burst 0 last 1 next
> 67
> auth_agekeys: at 1 keys 1 expired 0
> timer: refresh ts 0
> input_handler: if=2 fd=6 length 48 from 958a013b 141.138.1.59
> addto_syslog: input_handler: Processed a gob of fd's in 0.041000 msec
> receive: at 1 141.138.16.220<-141.138.1.59 restrict 001
> addto_syslog: select(): nfound=-1, error: Interrupted system call
> refclock_transmit: at 2 127.127.1.0
> refclock_receive: at 2 127.127.1.0
> peer LOCAL(0) event 'event_reach' (0x84) status 'unreach, conf, 1
> event, event_r
> each' (0x8014)
> refclock_sample: n 1 offset 0.000000 disp 0.010000 jitter 0.000000
> clock_filter: n 1 off 0.000000 del 0.000000 dsp 7.937501 jit 0.000001,
> age 2
> poll_update: at 2 127.127.1.0 flags 0021 poll 6 burst 0 last 2 next 67
> ...about 60 messages:
> addto_syslog: select(): nfound=-1, error: Interrupted system call
> ...
> auth_agekeys: at 60 keys 1 expired 0
> ...10 more
> addto_syslog: select(): nfound=-1, error: Interrupted system call
> ...
> refclock_transmit: at 67 127.127.1.0
> refclock_receive: at 67 127.127.1.0
> refclock_sample: n 1 offset 0.000000 disp 0.010000 jitter 0.000000
> clock_filter: n 2 off 0.000000 del 0.000000 dsp 3.937745 jit 0.000001,
> age 65
> poll_update: at 67 127.127.1.0 flags 0021 poll 6 burst 0 last 67 next
> 131
>         MCAST   *****sendpkt(fd=6 dst=141.138.1.59,
> src=141.138.16.220, ttl=0, l
> en=48)
> transmit: at 67 141.138.16.220->141.138.1.59 mode 3
> poll_update: at 67 141.138.1.59 flags 0001 poll 6 burst 0 last 67 next
> 131
> input_handler: if=2 fd=6 length 48 from 958a013b 141.138.1.59
> addto_syslog: input_handler: Processed a gob of fd's in 0.036000 msec
> receive: at 67 141.138.16.220<-141.138.1.59 restrict 001
> ...70 more
> addto_syslog: select(): nfound=-1, error: Interrupted system call
> ...
> auth_agekeys: at 120 keys 1 expired 0
> addto_syslog: select(): nfound=-1, error: Interrupted system call
> addto_syslog: select(): nfound=-1, error: Interrupted system call
> addto_syslog: select(): nfound=-1, error: Interrupted system call
> ...you get the idea
> 
> Thanks,
> Mike

Oops, someone upgrade the Redhat 8 box, so what you see comes from two
RHEL servers.  On Redhat 8 I get a Segmentation Fault:
# ntpd -x
ntpd -D4 -x
Debug1: 4 -> 4 = 4
ntpd 4.2.0 at 1.1161-r Wed Oct 22 13:00:51 MST 2003 (2)
Debug1: 4 -> 4 = 4
addto_syslog: ntpd 4.2.0 at 1.1161-r Wed Oct 22 13:00:51 MST 2003 (2)
addto_syslog: signal_no_reset: signal 13 had flags 4000000
addto_syslog: set_process_priority: Leave priority alone:
priority_done is <2>
addto_syslog: precision = 1.000 usec
create_sockets(123)
addto_syslog: no IPv6 interfaces found
address_okay: listen Virtual: 1, IF name: lo, Up Flag: 1
address_okay: listen Virtual: 1, IF name: eth0, Up Flag: 1
bind() fd 4, family 2, port 123, addr 0.0.0.0, flags=8
flags for fd 4: 04002
bind() fd 5, family 2, port 123, addr 127.0.0.1, flags=0
flags for fd 5: 04002
bind() fd 6, family 2, port 123, addr 141.138.9.116, flags=8
flags for fd 6: 04002
create_sockets: ninterfaces=3
interface 0:  fd=4,  bfd=-1,  name=wildcard,  flags=0x8
              sin=0.0.0.0  bcast=0.0.0.0,  mask=255.255.255.255
interface 1:  fd=5,  bfd=-1,  name=lo,  flags=0x5
              sin=127.0.0.1  mask=255.0.0.0
interface 2:  fd=6,  bfd=-1,  name=eth0,  flags=0x9
              sin=141.138.9.116  bcast=141.138.9.255, 
mask=255.255.255.0
init_io: maxactivefd 6
local_clock: at 0 state 0
Debug2: 4 -> 4 = 4
getaddrinfo 127.0.0.1
getnetnum given 127.0.0.1, got 127.0.0.1
getaddrinfo ntpserver
Segmentation fault

Mike



More information about the questions mailing list