From: Peter van Dijk Date: Tue, 3 Nov 2020 19:36:02 +0000 (+0100) Subject: auth pdns.conf, pdnsutil, pdns_control: modern aliases for master/slave X-Git-Tag: dnsdist-1.6.0-rc1~32^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cbe4a2aa4ec23a049d4df83e788910f2c3c89b5;p=thirdparty%2Fpdns.git auth pdns.conf, pdnsutil, pdns_control: modern aliases for master/slave --- diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index db4b4aa5dc..7d646f5bfa 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -141,15 +141,19 @@ void declareArguments() ::arg().set("also-notify", "When notifying a domain, also notify these nameservers")=""; ::arg().set("allow-notify-from","Allow AXFR NOTIFY from these IP ranges. If empty, drop all incoming notifies.")="0.0.0.0/0,::/0"; ::arg().set("slave-cycle-interval","Schedule slave freshness checks once every .. seconds")="60"; + ::arg().set("replication-cycle-interval","Schedule primary/secondary replication freshness checks once every .. seconds")="60"; ::arg().set("tcp-control-address","If set, PowerDNS can be controlled over TCP on this address")=""; ::arg().set("tcp-control-port","If set, PowerDNS can be controlled over TCP on this address")="53000"; ::arg().set("tcp-control-secret","If set, PowerDNS can be controlled over TCP after passing this secret")=""; ::arg().set("tcp-control-range","If set, remote control of PowerDNS is possible over these networks only")="127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, ::1/128, fe80::/10"; - ::arg().setSwitch("slave","Act as a slave")="no"; - ::arg().setSwitch("master","Act as a master")="no"; - ::arg().setSwitch("superslave", "Act as a superslave")="no"; + ::arg().setSwitch("slave","Act as a secondary")="no"; + ::arg().setSwitch("secondary","Act as a secondary")="no"; + ::arg().setSwitch("master","Act as a primary")="no"; + ::arg().setSwitch("primary","Act as a primary")="no"; + ::arg().setSwitch("superslave", "Act as a autosecondary (formerly superslave)")="no"; + ::arg().setSwitch("autosecondary", "Act as an autosecondary")="no"; ::arg().setSwitch("disable-axfr-rectify","Disable the rectify step during an outgoing AXFR. Only required for regression testing.")="no"; ::arg().setSwitch("guardian","Run within a guardian process")="no"; ::arg().setSwitch("prevent-self-notification","Don't send notifications to what we think is ourself")="yes"; @@ -184,7 +188,8 @@ void declareArguments() ::arg().set("domain-metadata-cache-ttl","Seconds to cache domain metadata from the database")="60"; ::arg().set("trusted-notification-proxy", "IP address of incoming notification proxy")=""; - ::arg().set("slave-renotify", "If we should send out notifications for slaved updates")="no"; + ::arg().set("slave-renotify", "If we should send out notifications for secondaried updates")="no"; + ::arg().set("secondary-renotify", "If we should send out notifications for secondaried updates")="no"; ::arg().set("forward-notify", "IP addresses to forward received notifications to regardless of master or slave settings")=""; ::arg().set("default-ttl","Seconds a result is valid if not set otherwise")="3600"; @@ -573,7 +578,7 @@ void mainthread() } #endif triggerLoadOfLibraries(); - if(::arg().mustDo("master") || ::arg().mustDo("slave")) + if(::arg().mustDo("master") || ::arg().mustDo("slave") || ::arg().mustDo("primary") || ::arg().mustDo("secondary")) gethostbyname("a.root-servers.net"); // this forces all lookup libraries to be loaded Utility::dropGroupPrivs(newuid, newgid); if(chroot(::arg()["chroot"].c_str())<0 || chdir("/")<0) { @@ -650,7 +655,7 @@ void mainthread() if(::arg().mustDo("webserver") || ::arg().mustDo("api")) webserver.go(); - if(::arg().mustDo("slave") || ::arg().mustDo("master") || !::arg()["forward-notify"].empty()) + if(::arg().mustDo("slave") || ::arg().mustDo("master") || ::arg().mustDo("primary") || ::arg().mustDo("secondary")|| !::arg()["forward-notify"].empty()) Communicator.go(); TN->go(); // tcp nameserver launch diff --git a/pdns/communicator.cc b/pdns/communicator.cc index 19135f8c86..dda4909456 100644 --- a/pdns/communicator.cc +++ b/pdns/communicator.cc @@ -112,9 +112,9 @@ void CommunicatorClass::mainloop() try { setThreadName("pdns/comm-main"); signal(SIGPIPE,SIG_IGN); - g_log<&parts, Utility::pid_t ppid) ostringstream os; if(parts.size()!=3) return "syntax: notify-host domain ip"; - if(!::arg().mustDo("master") && !(::arg().mustDo("slave") && ::arg().mustDo("slave-renotify"))) - return "PowerDNS not configured as master or slave with re-notifications"; + if(!(::arg().mustDo("master") || ::arg().mustDo("primary")) && !((::arg().mustDo("slave") || ::arg().mustDo("secondary")) && ::arg().mustDo("slave-renotify"))) + return "PowerDNS not configured as primary (master), or secondary (slave) with re-notifications"; DNSName domain; try { @@ -317,8 +317,8 @@ string DLNotifyHandler(const vector&parts, Utility::pid_t ppid) UeberBackend B; if(parts.size()!=2) return "syntax: notify domain"; - if(!::arg().mustDo("master") && !(::arg().mustDo("slave") && ::arg().mustDo("slave-renotify"))) - return "PowerDNS not configured as master or slave with re-notifications"; + if(!(::arg().mustDo("master") || ::arg().mustDo("primary")) && !((::arg().mustDo("slave") || ::arg().mustDo("secondary")) && ::arg().mustDo("slave-renotify"))) + return "PowerDNS not configured as primary (master), or secondary (slave) with re-notifications"; g_log<&parts, Utility::pid_t ppid) ostringstream ret; int kindFilter = -1; if (parts.size() > 1) { - if (toUpper(parts[1]) == "MASTER") + if (toUpper(parts[1]) == "MASTER" || toUpper(parts[1]) == "PRIMARY") kindFilter = 0; - else if (toUpper(parts[1]) == "SLAVE") + else if (toUpper(parts[1]) == "SLAVE" || toUpper(parts[1]) == "SECONDARY") kindFilter = 1; else if (toUpper(parts[1]) == "NATIVE") kindFilter = 2; diff --git a/pdns/mastercommunicator.cc b/pdns/mastercommunicator.cc index 624a2e65d3..686b3706f1 100644 --- a/pdns/mastercommunicator.cc +++ b/pdns/mastercommunicator.cc @@ -138,7 +138,7 @@ void NotificationQueue::dump() void CommunicatorClass::masterUpdateCheck(PacketHandler *P) { - if(!::arg().mustDo("master")) + if(!::arg().mustDo("master") && !::arg().mustDo("primary")) return; UeberBackend *B=P->getBackend(); diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index fb3ed7a883..5e77a80d76 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -961,7 +961,7 @@ int PacketHandler::processNotify(const DNSPacket& p) g_log<getBackend(); vector rdomains; diff --git a/regression-tests/backends/gsqlite3-slave b/regression-tests/backends/gsqlite3-slave index e5afc84aa9..5e5551a346 100644 --- a/regression-tests/backends/gsqlite3-slave +++ b/regression-tests/backends/gsqlite3-slave @@ -34,8 +34,8 @@ __EOF__ $RUNWRAPPER $PDNS2 --daemon=no --local-port=$port --config-dir=. \ --config-name=gsqlite32 --socket-dir=./ --no-shuffle \ - --slave --retrieval-threads=4 \ - --slave-cycle-interval=300 --dname-processing & + --secondary --retrieval-threads=4 \ + --replication-cycle-interval=300 --dname-processing & echo 'waiting for zones to be slaved' set +e