From: Christian Hofstaedtler Date: Tue, 22 Oct 2013 14:25:48 +0000 (+0200) Subject: remove windows service entry points X-Git-Tag: rec-3.6.0-rc1~370^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f7e8bd4967fe13c592298da4143a4d95979fe32;p=pdns remove windows service entry points --- diff --git a/pdns/dist-recursor b/pdns/dist-recursor index b8047f4ac..9cfb81114 100755 --- a/pdns/dist-recursor +++ b/pdns/dist-recursor @@ -24,7 +24,7 @@ rcpgenerator.hh lock.hh dnswriter.hh dnsrecords.hh dnsparser.hh utility.hh \ recursor_cache.hh rec_channel.hh qtype.hh misc.hh dns.hh syncres.hh \ sstuff.hh mtasker.hh mtasker.cc lwres.hh logger.hh pdnsexception.hh \ mplexer.hh \ -recursorservice.hh dns_random.hh lua-pdns.hh lua-recursor.hh namespaces.hh \ +dns_random.hh lua-pdns.hh lua-recursor.hh namespaces.hh \ recpacketcache.hh base32.hh cachecleaner.hh json.hh version.hh" CFILES="syncres.cc misc.cc unix_utility.cc qtype.cc \ @@ -32,7 +32,7 @@ logger.cc arguments.cc lwres.cc pdns_recursor.cc \ recursor_cache.cc dnsparser.cc dnswriter.cc dnsrecords.cc rcpgenerator.cc \ base64.cc zoneparser-tng.cc rec_channel.cc rec_channel_rec.cc rec_control.cc \ selectmplexer.cc epollmplexer.cc kqueuemplexer.cc portsmplexer.cc pdns_hw.cc \ -recursorservice.cc sillyrecords.cc lua-pdns.cc lua-recursor.cc randomhelper.cc \ +sillyrecords.cc lua-pdns.cc lua-recursor.cc randomhelper.cc \ devpollmplexer.cc recpacketcache.cc dns.cc reczones.cc base32.cc nsecrecords.cc \ dnslabeltext.cc json.cc json_ws.cc json_ws.hh version.cc" diff --git a/pdns/pdnsservice.cc b/pdns/pdnsservice.cc deleted file mode 100644 index 89f11e9fb..000000000 --- a/pdns/pdnsservice.cc +++ /dev/null @@ -1,78 +0,0 @@ -/* - PowerDNS Versatile Database Driven Nameserver - Copyright (C) 2002 PowerDNS.COM BV - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 - as published by the Free Software Foundation - - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "common_startup.hh" -#include "pdnsservice.hh" - - -// Control handler. -void PDNSService::ctrlHandler( DWORD controlCode ) -{ - if ( m_statusCode == SERVICE_STOPPED ) - exit( 0 ); - - switch ( controlCode ) - { - case SERVICE_CONTROL_STOP: - setStatus( SERVICE_STOP_PENDING ); - shutdown(); - setStatus( SERVICE_STOPPED ); - // FIXME: Add a cleaner way to do this: - break; - - case SERVICE_CONTROL_INTERROGATE: - setStatus( m_statusCode, m_errorCode ); - break; - - case SERVICE_CONTROL_SHUTDOWN: - setStatus( SERVICE_STOP_PENDING ); - shutdown(); - setStatus( SERVICE_STOPPED ); - // FIXME: Add a cleaner way to do this: - break; - } -} - - -// Returns the service name. -std::string PDNSService::getServiceName( void ) -{ - return "PowerDNS"; -} - - -// Main procedure. -int PDNSService::main( int argc, char *argv[] ) -{ - try - { - L << Logger::Info << Logger::NTLog << "PowerDNS " << VERSION << " (C) 2001-2003 PowerDNS.COM BV (" << __DATE__ ", " __TIME__<< ") starting up" << endl; - mainthread(); - } - catch(PDNSException &AE) { - if(!PDNSService::isRunningAsService()) - cerr<<"Exiting because: "< -#include "ntservice.hh" - -class PDNSService : public NTService -{ -protected: - //! Main service procedure. - int main( int argc, char *argv[] ); - - //! Control handler. - void ctrlHandler( DWORD controlCode ); - -public: - //! Constructor. - PDNSService( void ) : NTService() - { - } - - //! Returns the service name. - std::string getServiceName( void ); - -}; - -#endif // AHUDNSSERVICE_HH diff --git a/pdns/recursorservice.cc b/pdns/recursorservice.cc deleted file mode 100644 index d16d9191a..000000000 --- a/pdns/recursorservice.cc +++ /dev/null @@ -1,64 +0,0 @@ -/* - PowerDNS Versatile Database Driven Nameserver - Copyright (C) 2002 - 2006 PowerDNS.COM BV - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 - as published by the Free Software Foundation - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "recursorservice.hh" - -extern int serviceMain( int argc, char *argv[] ); - -// Control handler. -void RecursorService::ctrlHandler( DWORD controlCode ) -{ - if ( m_statusCode == SERVICE_STOPPED ) - exit( 0 ); - - switch ( controlCode ) - { - case SERVICE_CONTROL_STOP: - setStatus( SERVICE_STOP_PENDING ); - shutdown(); - setStatus( SERVICE_STOPPED ); - // FIXME: Add a cleaner way to do this: - break; - - case SERVICE_CONTROL_INTERROGATE: - setStatus( m_statusCode, m_errorCode ); - break; - - case SERVICE_CONTROL_SHUTDOWN: - setStatus( SERVICE_STOP_PENDING ); - shutdown(); - setStatus( SERVICE_STOPPED ); - // FIXME: Add a cleaner way to do this: - break; - } -} - - -// Returns the service name. -std::string RecursorService::getServiceName( void ) -{ - return "PowerDNS Recursor"; -} - - -// Main procedure. -int RecursorService::main( int argc, char *argv[] ) -{ - return serviceMain( argc, argv ); - -} diff --git a/pdns/recursorservice.hh b/pdns/recursorservice.hh deleted file mode 100644 index 55361f7d4..000000000 --- a/pdns/recursorservice.hh +++ /dev/null @@ -1,46 +0,0 @@ -/* - PowerDNS Versatile Database Driven Nameserver - Copyright (C) 2002 PowerDNS.COM BV - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 - as published by the Free Software Foundation - - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef AHUDNSSERVICE_HH -#define AHUDNSSERVICE_HH - -#include -#include "ntservice.hh" - -class RecursorService : public NTService -{ -protected: - //! Main service procedure. - int main( int argc, char *argv[] ); - - //! Control handler. - void ctrlHandler( DWORD controlCode ); - -public: - //! Constructor. - RecursorService( void ) : NTService() - { - } - - //! Returns the service name. - std::string getServiceName( void ); - -}; - -#endif // AHUDNSSERVICE_HH