[Pdns-users] TCP nameserver error with pipe backend
Gabriele Nencioni
gabriele.nencioni at register.it
Mon Sep 1 10:02:26 UTC 2014
Hello,
I am using PowerDNS with PipeBackend on a Linux machine.
The Backend is a perl script (attachment), very similar to the provided one.
Now when I am running TCP query the server is responding each second
time only while during the first one I get always the following error:
Aug 28 14:54:36 vm16 pdns[16924]: TCP nameserver had error, cycling
backend: Unable to ascertain status of coprocess 16853 from 16924: No
child processes
The processes tree is:
|-pdns_server(16849)-+-pdns_backend.pl(16853)
`-pdns_server(16851)-+-pdns_server(16852)
|-pdns_server(16854)
|-pdns_server(16855)---pdns__backend.pl(16856)
|-pdns_server(16857)---pdns__backend.pl(16858)
|-pdns_server(16859)---pdns__backend.pl(16860)
|-pdns_server(16861)
`-pdns_server(16924)
16924 has been created in order to serve the incoming tcp query and it
is unable to comunicate with 16853 and it dies; in the pdns log we have:
"Error from coprocess: Unable to ascertain status of coprocess 16853
from 16924: No child processes
TCP nameserver had error, cycling backend: Unable to ascertain status of
coprocess 16853 from 16924: No child processes"
The related strace log is:
[pid 16924] getsockname(9, {sa_family=AF_INET, sin_port=htons(53),
sin_addr=inet_addr("192.168.8.16")}, [16]) = 0
[pid 16924] waitpid(16853, 0xbebfeb6c, WNOHANG) = -1 ECHILD (No child
processes)
[pid 16924] send(3, ""..., 153, MSG_NOSIGNAL) = 153
[pid 16924] close(9) = 0
[pid 16924] exit_group(0)
The next tcp query in correctly handle by another pdns_server process
and the reply is sent back to the client; in the pdns log we have::
"TCP server is without backend connections, launching
Can't ignore signal CHLD, forcing to default.
Backend launched with banner: OK Sample backend firing up
899 Received: Q webserver.example.com IN ANY -1 192.168.8.16
899 Sent A records
899 End of data"
And then the next tcp query dies and after it tuns normally, and so on...
During the upd query that error is never arisen.
System information:
pdns: 2.9.22
perl: 5.8.7
os: slackware 10.2 (32 bit)
kernel: 2.6.33.2 #2 SMP i686
(Moreover on a debian7 2.6.32-5-amd64 #1 SMP 2012 x86_64 GNU/Linux
server, that error is never arisen during the upd and the tcp query.)
How can I resolve that problem?
Thanks in advance
Regards,
--
Gabriele Nencioni
System Administrator
eml gabriele.nencioni at register.it
-------------- next part --------------
#!/usr/bin/perl -w
# PowerDNS Coprocess backend
#
use strict;
$|=1; # no buffering
my $line=<>;
chomp($line);
unless($line eq "HELO\t1") {
print "FAIL\n";
print STDERR "Received '$line'\n";
<>;
exit;
}
print "OK PowerDNS Coprocess PipeBackend firing up\n"; # print our banner
while(<>)
{
print STDERR "$$ Received: $_";
chomp();
my @arr=split(/\t/);
if(@arr<6) {
print "LOG PowerDNS sent unparseable line\n";
print "FAIL\n";
next;
}
my ($type,$qname,$qclass,$qtype,$id,$ip)=split(/\t/);
if($qtype eq "SOA" || $qtype eq "ANY") {
print STDERR "$$ Sent SOA records\n";
print "DATA $qname $qclass SOA 3600 -1 ns1.register.it. hostmaster.register.it. 2014081801 10800 3600 604800 86400\n";
}
if($qtype eq "NS" || $qtype eq "ANY") {
print STDERR "$$ Sent NS records\n";
print "DATA $qname $qclass NS 3600 -1 ns1.register.it\n";
print "DATA $qname $qclass NS 3600 -1 ns2.register.it\n";
}
if($qtype eq "A" || $qtype eq "ANY") {
print STDERR "$$ Sent A records\n";
print "DATA $qname $qclass A 3600 -1 195.110.124.154\n";
}
print STDERR "$$ End of data\n";
print "END\n";
}
More information about the Pdns-users
mailing list