diff --git a/lib/cli/daemonutility.cpp b/lib/cli/daemonutility.cpp index fcf0cc50d..f5b436bda 100644 --- a/lib/cli/daemonutility.cpp +++ b/lib/cli/daemonutility.cpp @@ -126,12 +126,15 @@ bool DaemonUtility::ValidateConfigFiles(const std::vector& configs, * unfortunately moving it there is somewhat non-trivial. */ success = true; - String zonesEtcDir = Configuration::ZonesDir; - if (!zonesEtcDir.IsEmpty() && Utility::PathExists(zonesEtcDir)) - Utility::Glob(zonesEtcDir + "/*", std::bind(&IncludeZoneDirRecursive, _1, "_etc", std::ref(success)), GlobDirectory); + /* Only load zone directory if we're not in staging validation. */ + if (!systemNS->Contains("ZonesStageVarDir")) { + String zonesEtcDir = Configuration::ZonesDir; + if (!zonesEtcDir.IsEmpty() && Utility::PathExists(zonesEtcDir)) + Utility::Glob(zonesEtcDir + "/*", std::bind(&IncludeZoneDirRecursive, _1, "_etc", std::ref(success)), GlobDirectory); - if (!success) - return false; + if (!success) + return false; + } /* Load package config files - they may contain additional zones which * are authoritative on this node and are checked in HasZoneConfigAuthority(). */ @@ -148,6 +151,9 @@ bool DaemonUtility::ValidateConfigFiles(const std::vector& configs, /* Cluster config sync stage validation needs this. */ if (systemNS->Contains("ZonesStageVarDir")) { zonesVarDir = systemNS->Get("ZonesStageVarDir"); + + Log(LogDebug, "DaemonUtility") + << "Overriding zones var directory with '" << zonesVarDir << "' for cluster config sync staging."; } if (Utility::PathExists(zonesVarDir)) diff --git a/lib/remote/apilistener-filesync.cpp b/lib/remote/apilistener-filesync.cpp index 52203f9d1..8fe90ee43 100644 --- a/lib/remote/apilistener-filesync.cpp +++ b/lib/remote/apilistener-filesync.cpp @@ -364,6 +364,9 @@ void ApiListener::TryActivateZonesStageCallback(const ProcessResult& pr, /* validation went fine, copy stage and reload */ if (pr.ExitStatus == 0) { + Log(LogInformation, "ApiListener") + << "Config validation for stage '" << GetApiZonesStageDir() << "' was OK, triggering reload."; + for (const String& path : relativePaths) { /* TODO: Better error handling with existing files. */ Log(LogCritical, "ApiListener") @@ -381,7 +384,8 @@ void ApiListener::TryActivateZonesStageCallback(const ProcessResult& pr, Application::RequestRestart(); } else { Log(LogCritical, "ApiListener") - << "Config validation failed for staged cluster config sync. Stage not put in production, aborting."; + << "Config validation failed for staged cluster config sync. Aborting. Logs: '" + << GetApiZonesStageDir() + "/startup.log'"; } }