[Pdns-users] Problem with pipe backend scripts...

Laimonas Selenis cnm at takas.lt
Thu Jun 16 20:18:46 UTC 2005


bert hubert,  2005.06.16 16:52,  wrote:
>>Jun 16 12:43:34 xx pdns[21447]: AXFR of domain 'domain.com' initiated
>>by yyy.yyy.yyy.yyy
>>Jun 16 12:43:34 xx pdns[21447]: [PIPEBackend] Error from coprocess:
>>Unable to ascertain status of coprocess 21436 from 21447: No child
>>processes
> 
> 
> This appears to indicate your script exited, which it should not do.
> 
> Can you show your script?

Of course :) Here it is:

[code]

#!/usr/bin/perl -w
use strict;
$|=1;           # no buffering
my $line=<>;
chomp($line);
unless($line eq "HELO\t1")
{
  print "FAIL\n";
  print STDERR "Recevied '$line'\n";
  <>;
  exit;
}
print "OK       Sample backend firing up#2\n";  # print our banner
while(<>)
{
  chomp();
  my @arr=split(/\t/);
  if($_ !~ /^AXFR/)
  {
    if(@arr<6)
    {
      print "LOG      PowerDNS sent unparseable line: $_\n";
      print "FAIL\n";
      next;
    }

    my ($type,$qname,$qclass,$qtype,$id,$ip)=split(/\t/);
    if(length($qname)>0)
    {
      if($qtype eq "A" || $qtype eq "ANY")
      {
        print STDERR "$$ Sent A records\n";
        if($qname eq "ns1\.domain\.com")
        {
          print "DATA     $qname  $qclass A       86400   -1     
111.111.111.111\n";
        }
        elsif($qname eq "ns2\.domain\.com")
        {
          print "DATA     $qname  $qclass A       86400   -1     
111.111.111.111\n";
        }elsif($qname eq "ns2\.domain\.com")
        {
          print "DATA     $qname  $qclass A       86400   -1     
111.111.111.111\n";
        }else
        {
          print "DATA     $qname  $qclass A       86400   -1     
111.111.111.111\n";
        }
        if($qtype eq "ANY")
        {
          print "DATA     $qname  $qclass NS      86400   1      
ns1.domain.com.\n";
          print "DATA     $qname  $qclass NS      86400   1      
ns2.domain.com.\n";
        }
      }
      elsif($qtype eq "SOA")
      {
        print "DATA     $qname  $qclass $qtype  86400   1      
ns1.domain.com. hostmaster.domain.com. 0 10800 3600 604800 3600\n";
      }
      elsif($qtype eq "NS")
      {
        print "DATA     $qname  $qclass $qtype  86400   1      
ns1.domain.com.\n";
        print "DATA     $qname  $qclass $qtype  86400   1      
ns2.domain.com.\n";
      }
    }
  }
  print STDERR "$$ End of data\n";
  print "END\n";
}

[/code]

As I said, it is the same copy from manual plus some small modifications
. Maybe I made some mistakes here?

Thank you!

Laimonas


More information about the Pdns-users mailing list