Show
Ignore:
Timestamp:
08/22/03 15:33:31 (10 years ago)
Author:
ahu
Message:

lots of fixes, axfp ldap support, ldap ttl support, spurious debugging
output removed

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/pdns_recursor.cc

    r178 r180  
    3636#include "arguments.hh" 
    3737#include "syncres.hh" 
     38#include <fcntl.h> 
     39#include <fstream> 
     40 
     41string s_programname="pdns_recursor"; 
    3842 
    3943#ifndef WIN32 
     
    161165 
    162166 
     167static void writePid(void) 
     168{ 
     169  string fname=arg()["socket-dir"]+"/"+s_programname+".pid"; 
     170  ofstream of(fname.c_str()); 
     171  if(of) 
     172    of<<getpid()<<endl; 
     173  else 
     174    L<<Logger::Error<<"Requested to write pid for "<<getpid()<<" to "<<fname<<"failed: "<<strerror(errno)<<endl; 
     175} 
     176 
    163177void init(void) 
    164178{ 
     
    432446    arg().set("quiet","Suppress logging of questions and answers")="off"; 
    433447    arg().set("config-dir","Location of configuration directory (recursor.conf)")=SYSCONFDIR; 
     448    arg().set("socket-dir","Where the controlsocket will live")=LOCALSTATEDIR; 
    434449    arg().setCmd("help","Provide a helpful message"); 
    435450    L.toConsole(Logger::Warning); 
     
    471486    } 
    472487    signal(SIGUSR1,usr1Handler); 
     488 
     489    writePid(); 
    473490#endif 
    474491