OpenNTPD and IPv4 Only Kernel

Howdy!

I have a custom kernel installed, that does NOT allow IPv6. I cannot change that, and everything works fine - except for OpenNTPD which dies on start (I believe this is due to a DNS IPv6 record issue related to this bug here).

Code:
# /usr/local/etc/rc.d/openntpd start
Starting openntpd.
Lost child: child exited
Terminating

Code:
Mar 28 18:47:30 <ntp.info> ntpd[73382]: ntp engine ready
Mar 28 18:47:30 <ntp.crit>ntpd[73382]: fatal: client_query socket: Protocol not supported
Mar 28 18:47:30 <ntp.crit>ntpd[73383]: dispatch_imsg in main: pipe closed

I'm at the newest version of OpenNPTD (I think):
Code:
===>  Installing for openntpd-4.6_2,2
===>   Generating temporary packing list
===> Creating users and/or groups.
Using existing group `_ntp'.
Using existing user `_ntp'.
install  -s -o root -g wheel -m 555 /usr/ports/net/openntpd/work/ntpd/ntpd /usr/local/sbin
install  -o root -g wheel -m 444 /usr/ports/net/openntpd/work/ntpd/ntpd.conf.5 /usr/local/man/man5
install  -o root -g wheel -m 444 /usr/ports/net/openntpd/work/ntpd/ntpd.8 /usr/local/man/man8
install  -o root -g wheel -m 444 /usr/ports/net/openntpd/files/ntpd.conf /usr/local/share/examples/openntpd
===> Installing rc.d startup script(s)
===> Correct pkg-plist sequence to create group(s) and user(s)
===>   Compressing manual pages for openntpd-4.6_2,2
===>   Registering installation for openntpd-4.6_2,2

While the bug report (see above) says that it has been fixed....I don't believe it has as OpenNTPD still terminates for me.

Not sure where to go from here, aside from forcing myself to learn all the in's and out's of NTP and forcing it to use IPv4. Unfortunately I would rather not scrap the OpenNTPD thing (which I am a huge fan of).

Any help is appreciated.

~Pacman
 
Set the listen-on directive in /usr/local/etc/ntpd.conf to your explicit IPv4 address, example:

Code:
# Addresses to listen on (ntpd does not listen by default)
#listen on *
#listen on 127.0.0.1
#listen on ::1
listen on 192.168.2.1
 
DutchDaemon,

Thanks for the quick reply! This, however, is not the issue. I believe the issue to be that when the DNS records come back for the servers I want to sync to, they contain IPv6 addresses as well as IPv4. There are no IPv6 addresses in my /usr/local/etc/ntpd.conf file, reproduced below.

Code:
# Addresses to listen on (ntpd does not listen by default)
listen on 192.168.32.212
listen on 127.0.0.1

servers 0.us.pool.ntp.org
servers 1.us.pool.ntp.org
servers 2.us.pool.ntp.org

~Pacman
 
EDIT:

That DNS Stuff comes from the link I supplied in my first post, reproduced:

and the specific error I think I may be up against:
on some machines the openntpd dies after random time. The machines have
only ipv4 enabled, and strace give me this output:
Code:
[pid 23264] poll( <unfinished ...>
[pid 23260] <... poll resumed> [{fd=4, events=POLLIN}, {fd=-1}], 2, 514000) = 0
[pid 23260] time(NULL)                  = 1222730519
[pid 23260] time(NULL)                  = 1222730519
[pid 23260] socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = -1 EAFNOSUPPORT (Address 
family not supported by protocol)
[pid 23260] write(2, "fatal: client_query socket: Addr"..., 69) = 69
[pid 23260] exit_group(1)               = ?
Process 23260 detached
<... poll resumed> [{fd=3, events=POLLIN, revents=POLLIN|POLLHUP}], 1, 15000) = 
1
read(3, "", 4096)                       = 0
time(NULL)                              = 1222730519
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2295, ...}) = 0
send(4, "<26>Sep 30 01:21:59 ntpd[23264]:"..., 67, MSG_NOSIGNAL) = 67
rt_sigaction(SIGCHLD, {SIG_DFL}, {0x80497c0, [CHLD], SA_RESTART}, 8) = 0
kill(23260, SIGTERM)                    = -1 ESRCH (No such process)
wait4(-1, NULL, 0, NULL)                = -1 ECHILD (No child processes)
time(NULL)                              = 1222730519
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2295, ...}) = 0
send(4, "<30>Sep 30 01:21:59 ntpd[23264]:"..., 44, MSG_NOSIGNAL) = 44
exit_group(0)                           = ?
Process 23264 detached

Seems that the opnentpd get'S from DNS an ipv6 record and dies.
The DNS Entry's for the used NTP Server's:
Code:
ntp0            IN A            194.97.4.214
                IN AAAA         2001:748:100:60::2
ntp1            IN A            194.97.5.110
                IN AAAA         2001:748:200:4::2

~Pacman
 
For now, comment out
Code:
servers 2.us.pool.ntp.org
It seems to work fine with 0 and 1. Though 2 does not seem to contain IPv6 hosts.
 
Dutch,

I NEVER would have even thought to check that. I confirmed it works with any number and combination of (0, 1, 3, or 4).us.pool.ntp.org. How did you come across thinking of removing 2.us.pool.ntp.org? Also, a dig on that address returns no IPv6 (from an IPv6 enabled machine)

Code:
; <<>> DiG 9.7.6-P1 <<>> 2.us.pool.ntp.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53175
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;2.us.pool.ntp.org.		IN	A

;; ANSWER SECTION:
2.us.pool.ntp.org.	150	IN	A	72.8.140.240
2.us.pool.ntp.org.	150	IN	A	69.50.219.51
2.us.pool.ntp.org.	150	IN	A	24.25.4.103
2.us.pool.ntp.org.	150	IN	A	108.61.56.35

;; Query time: 45 msec
;; SERVER: <REDACTED>
;; WHEN: Mon Apr  1 14:50:33 2013
;; MSG SIZE  rcvd: 99

Is it truly a IPv4 vs IPv6 enabled kernel problem? Or do you think there is something funny going on with 2.us.pool.ntp.org? I just want to avoid having this crop up again and me not notice it.

Thanks a bunch!

~Pacman
 
This was a classic example of 'just trying something and finding that it worked'. No other system or conclusion should be derived from that.
 
Back
Top