[Pdns-users] pipe backend logging
Randall Diffenderfer
rdiffenderfer at proofpoint.com
Fri Nov 30 19:37:27 UTC 2018
using centos rpm for powerdns, version 3.4.11 (this would seem to be old, but it's what they supply).
using the simple pipe co-process code for perl and trying to figure out where debug log print lines should end up.
i cannot see anything going to the /tmp/pipe.err file, even though it is in /tmp and 777'd. huh?
==================
#!/usr/bin/perl
# sample PowerDNS Coprocess backend
#
use warnings;
use strict;
$|=1; # no buffering
my $line=<>;
chomp($line);
sub debug_log_a_line {
`touch /tmp/pipe.err`;
open( my $errfh, ">> /tmp/pipe.err" ) || die();
print $errfh "$$ debug_log_a_line call\n";
foreach ( @_ ) {
print $errfh $_;
}
close $errfh;
return;
}
unless($line eq "HELO\t1") {
print "FAIL\n";
debug_log_a_line( "Received '$line'\n" );
<>;
exit;
}
debug_log_a_line( "$$ Starting...\n" );
print "OK\tPipe backend firing up\n"; # print our banner
=================
syslog:
Nov 30 19:23:41 m0095044 pdns[19770]: Backend launched with banner: OK#011Pipe backend firing up
when configured into pds.conf file, i see the banner line show up in syslog messages, but nothing in the pipe.err file.
when i run this as a standalone (without setuid/setguid) stuff prints as expected, and updates the pipe.err file as expected...
this seems exceedingly strange. what am i overlooking here???
tia!
More information about the Pdns-users
mailing list