# ntpd woes.

## tecknojunky

# /usr/sbin/ntpd -u ntp:ntp -D 99

```
Debug1: 99 -> 63 = 99

ntpd 4.2.0a@1.1190-r Wed Nov 17 00:56:26 EST 2004 (1)

Debug1: 99 -> 63 = 99

addto_syslog: ntpd 4.2.0a@1.1190-r Wed Nov 17 00:56:26 EST 2004 (1)

adding new filegen

adding new filegen

adding new filegen

adding new filegen

adding new filegen

addto_syslog: set_process_priority: Leave priority alone: priority_done is <2>

addto_syslog: precision = 1.000 usec

create_sockets(123)

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

addto_syslog: Listening on interface wildcard, 0.0.0.0#123

bind() fd 5, family 10, port 123, addr ::, flags=0

flags for fd 5: 04002

addto_syslog: Listening on interface wildcard, ::#123

bind() fd 6, family 2, port 123, addr 127.0.0.1, flags=0

flags for fd 6: 04002

addto_syslog: Listening on interface lo, 127.0.0.1#123

bind() fd 7, family 2, port 123, addr 192.168.1.11, flags=8

flags for fd 7: 04002

addto_syslog: Listening on interface eth0, 192.168.1.11#123

create_sockets: ninterfaces=4

interface 0:  fd=4,  bfd=-1,  name=wildcard,  flags=0x8,  scope=0

              sin=0.0.0.0  bcast=0.0.0.0,  mask=255.255.255.255

interface 1:  fd=5,  bfd=-1,  name=wildcard,  flags=0x0,  scope=0

              sin=::  mask=ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff

interface 2:  fd=6,  bfd=-1,  name=lo,  flags=0x5,  scope=0

              sin=127.0.0.1  mask=255.0.0.0

interface 3:  fd=7,  bfd=-1,  name=eth0,  flags=0x9,  scope=0

              sin=192.168.1.11  bcast=192.168.1.255,  mask=255.255.255.0

init_io: maxactivefd 7

local_clock: time 0 clock 0.000000 offset 0.000000 freq 0.000 state 0

Debug2: 99 -> 63 = 99

getaddrinfo pool.ntp.org

getnetnum given pool.ntp.org, got 80.38.245.22

peer_clear: at 0 assoc ID 3116 refid INIT

newpeer: 192.168.1.11->80.38.245.22 mode 3 vers 4 poll 6 10 flags 0x1 0x1 ttl 0 key 00000000

addto_syslog: Frequency format error in /var/lib/ntp/ntp.drift

getaddrinfo 127.0.0.1

getnetnum given 127.0.0.1, got 127.0.0.1

getaddrinfo 192.168.1.0

getnetnum given 192.168.1.0, got 192.168.1.0

getaddrinfo 255.255.255.0

getnetnum given 255.255.255.0, got 255.255.255.0

authtrust: keyid 0000ffff life 1

report_event: system event 'event_restart' (0x01) status 'sync_alarm, sync_unspec, 1 event, event_unspec' (0xc010)

getrecvbufs called, no action here

addto_syslog: select(): nfound=-1, error: Interrupted system call

getrecvbufs called, no action here

        MCAST   *****sendpkt(fd=7 dst=80.38.245.22, src=192.168.1.11, ttl=0, len=48)

transmit: at 1 192.168.1.11->80.38.245.22 mode 3

poll_update: at 1 80.38.245.22 flags 0001 poll 6 burst 0 last 1 next 64

auth_agekeys: at 1 keys 1 expired 0

getrecvbufs called, no action here

input_handler: if=3 fd=7 length 48 from 5026f516 80.38.245.22

addto_syslog: input_handler: Processed a gob of fd's in 0.250000 msec

getrecvbufs returning 1 buffers

receive: at 1 192.168.1.11<-80.38.245.22 restrict 090

receive: at 1 192.168.1.11<-80.38.245.22 mode 4 code 1

peer 80.38.245.22 event 'event_reach' (0x84) status 'unreach, conf, 1 event, event_reach' (0x8014)

poll_update: at 1 80.38.245.22 flags 0001 poll 6 burst 0 last 1 next 67

clock_filter: popcorn 0.136006 0.000015

getrecvbufs called, no action here

addto_syslog: select(): nfound=-1, error: Interrupted system call

getrecvbufs called, no action here

getrecvbufs called, no action here

addto_syslog: select(): nfound=-1, error: Interrupted system call

getrecvbufs called, no action here

getrecvbufs called, no action here

addto_syslog: select(): nfound=-1, error: Interrupted system call

getrecvbufs called, no action here

getrecvbufs called, no action here

addto_syslog: select(): nfound=-1, error: Interrupted system call

getrecvbufs called, no action here

getrecvbufs called, no action here

addto_syslog: select(): nfound=-1, error: Interrupted system call

.

.

.

ad nauseam

```

I tought it was related to ipv6, but I compiled it (ntp-4.2.0.20040617) with -ipv6.

----------

## Andersson

Did this happen suddenly, or has it been like this since installation? Could you post your config?

You seem to be able to reach the ntp server... look at these lines for example:

```
getaddrinfo pool.ntp.org 

getnetnum given pool.ntp.org, got 80.38.245.22 

peer_clear: at 0 assoc ID 3116 refid INIT 

newpeer: 192.168.1.11->80.38.245.22 mode 3 vers 4 poll 6 10 flags 0x1 0x1 ttl 0 key 00000000
```

So I think the connection is fine. Perhaps you have a problem with a "restrict" line in the config? Post your configuration and some more information about the problem if you have it.

----------

## tecknojunky

 *Andersson wrote:*   

> Did this happen suddenly, or has it been like this since installation?

 Well, it's been like this since the installation, but I realized this in a recent installation on a cluster for which I want to have one node being the time server for the other nodes.  

 *Andersson wrote:*   

> Could you post your config?

 Sure.

/etc/ntp.conf

```
# 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 66.90.103.89

server 82.219.3.129

server 80.85.129.25

#server pool.ntp.org

 

##

# A list of available servers can be found here:

# http://www.pool.ntp.org/

# A good way to get servers for your machine is:

# netselect -s 3 pool.ntp.org

##

 

# 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 deny other machines from changing the

# configuration but allow localhost:

restrict default nomodify nopeer

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 nomodify nopeer notrap
```

Originaly, their was on one server pool.ntp.org directive.  With servers IP directly changes nothing in the behavior.

/etc/conf.d/

```
# Copyright 1999-2004 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/net-misc/ntp/files/ntpd.confd,v 1.15 2004/07/15 00:05:46 agriffis Exp $

 

# 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="-u ntp:ntp"
```

This is all on the to-be time server which generate the message I posted earlier.

----------

## Andersson

I don't think you're giving your time servers permission to connect to you (the nopeer option).

Look at this thread: https://forums.gentoo.org/viewtopic.php?t=41099&start=58

(or just try and replace your restrict lines with these taken from Garth's post in the above thread):

```

# deny all machines from accessing the NTP server 

restrict default ignore 

  

# allow localhost, but don't sync to local harware clock 

restrict 127.0.0.1 nopeer 

  

# 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 

restrict 192.168.1.0 mask 255.255.255.0 nomodify nopeer 

  

# allow access from the above time servers

restrict 66.90.103.89 nomodify 

restrict 82.219.3.129 nomodify 

restrict 80.85.129.25 nomodify

```

----------

## tecknojunky

Aaaaah!!!  My clocks are synced!  :Confused: 

Thanks.

----------

## MatzeOne

another method that works just perferct for me is the use of rdate in combination with a cronjob

----------

## Andersson

 *MatzeOne wrote:*   

> another method that works just perferct for me is the use of rdate in combination with a cronjob

 

That solution is not as perfect as you claim, but it might be good enough. It could mess up compilations and confuse other programs, in case your clock is running fast and the rdate cron job is started while the other process is running. (And in gentoo there's always a compilation in progress)  :Smile: 

----------

## tecknojunky

 *Andersson wrote:*   

> (And in gentoo there's always a compilation in progress) 

 Ain't that the truth.  :Wink: 

----------

## MatzeOne

 :Shocked:  never noticed a problem with a compilation and a rdate-cronjob

----------

