[Pdns-users] powerdns compling on AXP Alpha FreeBSD 5.1 fails

Scott K scottk at microbsd.net
Mon Jul 28 18:16:10 UTC 2003


apparently the FreeBSD ports maintainer for PDN has added code
heres the ls- al output directly from the FreeBSD ports tree
 ls -al files/
total 30
drwxrwxr-x  2 100   100   512 Jul 27 02:06 .
drwxrwxr-x  4 100   100   512 Jul 28 01:36 ..
-rw-r--r--  1 100   100  1195 Mar 23 04:29 configure.powerdns
-rw-r--r--  1 100   100   297 Jan 20  2003 patch-configure
-rw-r--r--  1 100   100   642 Jan 20  2003
patch-modules_gmysqlbackend_Makefile_in
-rw-r--r--  1 100   100  1170 Jan 20  2003
patch-modules_gpgsqlbackend_Makefile_in
-rw-r--r--  1 100   100   205 Jan 20  2003
patch-modules_gpgsqlbackend_OBJECTLIBS
-rw-r--r--  1 100   100   620 Jan 20  2003
patch-modules_pipebackend_Makefile_in
-rw-r--r--  1 root  100  1334 Jul 25 13:03 patch-pdns_pdns_recursor.cc
-rw-r--r--  1 100   100  6694 Jan 20  2003 pdns.conf
-rw-r--r--  1 100   100  1120 Jan 20  2003 pdns_mysql.sql
-rw-r--r--  1 100   100  1319 Jan 20  2003 pdns_postgresql.sql

and the offending file patch, notice lines 129-133
axp# cat files/patch-pdns_pdns_recursor.cc
--- pdns/pdns_recursor.cc.orig  Thu Jul  3 10:30:03 2003
+++ pdns/pdns_recursor.cc       Thu Jul 10 16:45:27 2003
@@ -35,6 +35,10 @@
 #include "statbag.hh"
 #include "arguments.hh"
 #include "syncres.hh"
+#include <fcntl.h>
+#include <fstream>
+
+string s_programname="pdns_recursor";

 #ifndef WIN32
 extern "C" {
@@ -129,6 +133,17 @@
   cache[toLower(qname)+"|"+qt.getName()]=content;
 }

+static void writePid(void)
+{
+  string fname=arg()["socket-dir"]+"/"+s_programname+".pid";
+  ofstream of(fname.c_str());
+  if(of)
+    of<<getpid()<<endl;
+  else
+    L<<Logger::Error<<"Requested to write pid for "<<getpid()<<" to
"<<fname<<"
+failed: "<<strerror(errno)<<endl;
+}
+
 void init(void)
 {
   // prime root cache
@@ -394,6 +409,7 @@
     arg().set("daemon","Operate as a daemon")="yes";
     arg().set("quiet","Suppress logging of questions and
answers")="off";
     arg().set("config-dir","Location of configuration directory
(recursor.conf)")=SYSCONFDIR;
+    arg().set("socket-dir","Where the controlsocket will
live")=LOCALSTATEDIR;
     arg().setCmd("help","Provide a helpful message");
     L.toConsole(Logger::Warning);
     arg().laxParse(argc,argv); // do a lax parse
@@ -433,6 +449,8 @@
       daemonize();
     }
     signal(SIGUSR1,usr1Handler);
+
+    writePid();
 #endif

     vector<TCPConnection> tcpconnections;




On Mon, 2003-07-28 at 18:07, bert hubert wrote:
> On Mon, Jul 28, 2003 at 06:01:11PM +0000, Scott K wrote:
> > lines 136 - 172
> > 
> > static void writePid(void)
> > {
> >   string fname=arg()["socket-dir"]+"/"+s_programname+".pid";
> >   ofstream of(fname.c_str());
> >   if(of)
> >     of<<getpid()<<endl;
> >   else
> >     L<<Logger::Error<<"Requested to write pid for "<<getpid()<<" to
> > "<<fname<<"
> > failed: "<<strerror(errno)<<endl;
> > }
> > 
> > void init(void)
> > {
> >   // prime root cache
> >   static char*ips[]={"198.41.0.4", "128.9.0.107", "192.33.4.12",
> 
> This is not my code - there is no writePid() in my pdns_recursor.cc - I
> suggest you retry with the stock pdns-2.9.10 or 2.9.11
> (http://ds9a.nl/pdns).
> 
> Thanks.



More information about the Pdns-users mailing list