}
#endif
triggerLoadOfLibraries();
- if(::arg().mustDo("master") || ::arg().mustDo("slave") || ::arg().mustDo("primary") || ::arg().mustDo("secondary"))
+ if(::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) {
if(::arg().mustDo("webserver") || ::arg().mustDo("api"))
webserver.go();
- if(::arg().mustDo("slave") || ::arg().mustDo("master") || ::arg().mustDo("primary") || ::arg().mustDo("secondary")|| !::arg()["forward-notify"].empty())
+ if(::arg().mustDo("primary") || ::arg().mustDo("secondary")|| !::arg()["forward-notify"].empty())
Communicator.go();
TN->go(); // tcp nameserver launch
ostringstream os;
if(parts.size()!=3)
return "syntax: notify-host domain ip";
- if(!(::arg().mustDo("master") || ::arg().mustDo("primary")) && !((::arg().mustDo("slave") || ::arg().mustDo("secondary")) && ::arg().mustDo("slave-renotify")))
+ if(!::arg().mustDo("primary") && !(::arg().mustDo("secondary") && ::arg().mustDo("secondary-renotify")))
return "PowerDNS not configured as primary (master), or secondary (slave) with re-notifications";
DNSName domain;
UeberBackend B;
if(parts.size()!=2)
return "syntax: notify domain";
- if(!(::arg().mustDo("master") || ::arg().mustDo("primary")) && !((::arg().mustDo("slave") || ::arg().mustDo("secondary")) && ::arg().mustDo("slave-renotify")))
+ if(!::arg().mustDo("primary") && !(::arg().mustDo("secondary") && ::arg().mustDo("secondary-renotify")))
return "PowerDNS not configured as primary (master), or secondary (slave) with re-notifications";
g_log<<Logger::Warning<<"Notification request for domain '"<<parts[1]<<"' received from operator"<<endl;
void CommunicatorClass::masterUpdateCheck(PacketHandler *P)
{
- if(!::arg().mustDo("master") && !::arg().mustDo("primary"))
+ if(!::arg().mustDo("primary"))
return;
UeberBackend *B=P->getBackend();
g_log<<Logger::Debug<<"Received NOTIFY for "<<p.qdomain<<" from "<<p.getRemote()<<endl;
- if(!::arg().mustDo("slave") && !::arg().mustDo("secondary") && s_forwardNotify.empty()) {
+ if(!::arg().mustDo("secondary") && s_forwardNotify.empty()) {
g_log<<Logger::Warning<<"Received NOTIFY for "<<p.qdomain<<" from "<<p.getRemote()<<" but slave support is disabled in the configuration"<<endl;
return RCode::Refused;
}
//
DomainInfo di;
if(!B.getDomainInfo(p.qdomain, di, false) || !di.backend) {
- if(::arg().mustDo("superslave") || ::arg().mustDo("autosecondary")) {
+ if(::arg().mustDo("autosecondary")) {
g_log<<Logger::Warning<<"Received NOTIFY for "<<p.qdomain<<" from "<<p.getRemote()<<" for which we are not authoritative, trying supermaster"<<endl;
return trySuperMaster(p, p.getTSIGKeyname());
}
}
g_log<<Logger::Notice<<"Received NOTIFY for "<<p.qdomain<<" from trusted-notification-proxy "<<p.getRemote()<<endl;
}
- else if((::arg().mustDo("master") || ::arg().mustDo("primary")) && di.kind == DomainInfo::Master) {
+ else if(::arg().mustDo("primary") && di.kind == DomainInfo::Master) {
g_log<<Logger::Warning<<"Received NOTIFY for "<<p.qdomain<<" from "<<p.getRemote()<<" but we are master (Refused)"<<endl;
return RCode::Refused;
}
}
}
- if(::arg().mustDo("slave") || ::arg().mustDo("secondary")) {
+ if(::arg().mustDo("secondary")) {
g_log<<Logger::Notice<<"Received NOTIFY for "<<p.qdomain<<" from "<<p.getRemote()<<" - queueing check"<<endl;
Communicator.addSlaveCheckRequest(di, p.d_remote);
}
g_log<<Logger::Error<<"Unknown logging facility "<<::arg().asNum("logging-facility") <<endl;
}
+ if (::arg().mustDo("master")) ::arg().set("primary")="yes";
+ if (::arg().mustDo("slave")) ::arg().set("secondary")="yes";
+ if (::arg().mustDo("slave-renotify")) ::arg().set("secondary-renotify")="yes";
+ if (::arg().mustDo("superslave")) ::arg().set("autosecondary")="yes";
+
+ // this mirroring back is on purpose, so that config dumps reflect the actual setting on both names
+ if (::arg().mustDo("primary")) ::arg().set("master")="yes";
+ if (::arg().mustDo("secondary")) ::arg().set("slave")="yes";
+ if (::arg().mustDo("secondary-renotify")) ::arg().set("slave-renotify")="yes";
+ if (::arg().mustDo("autosecondary")) ::arg().set("superslave")="yes";
+
g_log.setLoglevel((Logger::Urgency)(::arg().asNum("loglevel")));
g_log.disableSyslog(::arg().mustDo("disable-syslog"));
g_log.setTimestamps(::arg().mustDo("log-timestamp"));
void CommunicatorClass::slaveRefresh(PacketHandler *P)
{
// not unless we are slave
- if (!::arg().mustDo("slave") && !::arg().mustDo("secondary")) return;
+ if (!::arg().mustDo("secondary")) return;
UeberBackend *B=P->getBackend();
vector<DomainInfo> rdomains;